* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header matching Kompliance style */
.header {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    margin-right: 0.5rem;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
}

.header-logo {
    height: 80px;
    transition: all 0.3s ease;
    background-color: white;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-title-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.logo-title-container h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.last-updated {
    opacity: 0.8;
    font-size: 0.9em;
}

.logout-button {
    background: rgba(244, 67, 54, 0.8);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.logout-button:hover {
    background: rgba(244, 67, 54, 1);
}

.refresh-button {
    background: rgba(76, 175, 80, 0.8);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.refresh-button:hover {
    background: rgba(76, 175, 80, 1);
}

.dashboard-link-button {
    background: rgba(33, 150, 243, 0.8);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.dashboard-link-button:hover {
    background: rgba(33, 150, 243, 1);
}

/* Desktop-specific: Show time display in header middle */
@media (min-width: 769px) {
    #headerTimeDisplay {
        display: flex !important;
    }
    
    .logo-title-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

.hero-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* Section Navigation Menu */
.section-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.section-nav .nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0.8;
    font-size: 0.95rem;
}

.section-nav .nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.section-nav .nav-link.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

@media (max-width: 768px) {
    .section-nav {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .section-nav .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Main content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 2rem 0;
}

.section:first-of-type {
    padding-top: 3rem;
}

.section h2 {
    color: white;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.section p {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-align: left;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Auth section */
.auth-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin: 2rem auto;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input option {
    background: #2a5298;
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-primary {
    background: rgba(76, 175, 80, 0.8);
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-success {
    background: rgba(76, 175, 80, 0.8);
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.8);
    color: white;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.btn-warning {
    background: rgba(255, 152, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.btn-warning:hover {
    background: rgba(255, 152, 0, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.card h3 {
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* API Key Cards */
.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.api-key-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(76, 175, 80, 0.8);
    color: white;
}

.status-inactive {
    background: rgba(244, 67, 54, 0.8);
    color: white;
}

.api-key-details {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.api-key-details strong {
    color: white;
}

.api-key-code {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    word-break: break-all;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(76, 175, 80, 0.2);
    color: #c8e6c9;
    border-color: #4caf50;
}

.alert-error {
    background: rgba(244, 67, 54, 0.2);
    color: #ffcdd2;
    border-color: #f44336;
}

.alert-info {
    background: rgba(33, 150, 243, 0.2);
    color: #bbdefb;
    border-color: #2196f3;
}

/* Loading spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mb-0 { 
    margin-bottom: 0 !important; 
}
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.7; transform: scale(1); }
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

td {
    color: rgba(255, 255, 255, 0.9);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Badge styling */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-info {
    background: rgba(33, 150, 243, 0.8);
    color: white;
}

.badge-success {
    background: rgba(76, 175, 80, 0.8);
    color: white;
}

.badge-danger {
    background: rgba(244, 67, 54, 0.8);
    color: white;
}

/* Additional utility */
.error {
    background: rgba(244, 67, 54, 0.2);
    color: #ffcdd2;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(244, 67, 54, 0.5);
}

/* Code blocks */
code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

/* Links */
a {
    color: #90caf9;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #bbdefb;
}

/* Responsive */
@media (max-width: 768px) {
    /* Container and spacing */
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 1.5rem 0;
    }
    
    .section:first-of-type {
        padding-top: 1.5rem;
    }
    
    /* Hero section */
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    /* Hide time display on mobile to save space */
    #headerTimeDisplay {
        display: none !important;
    }
    
    /* User info header responsive styles */
    .user-info-header .container {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .user-info-header .logo-title-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .user-info-header .user-info {
        align-items: center;
        text-align: center;
    }
    
    .logo-title-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .header-logo {
        height: 60px;
        padding: 6px;
    }
    
    .user-info-header .user-info + div {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .user-info-header button,
    .user-info-header .dashboard-link-button {
        width: 100%;
        min-height: 44px; /* Better touch target */
        justify-content: center;
    }
    
    /* Stats grid - single column on very small screens */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.75em;
    }
    
    /* Auth card */
    .auth-card {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    .auth-title {
        font-size: 1.25rem;
    }
    
    /* Cards */
    .card {
        padding: 1.5rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-input {
        padding: 0.625rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons - full width on mobile */
    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.75rem;
        padding: 0.875rem 1.25rem;
        min-height: 44px; /* Better touch target */
        touch-action: manipulation; /* Prevents double-tap zoom */
    }
    
    .text-center .btn {
        width: auto;
        display: inline-block;
        min-height: 44px;
    }
    
    /* Navigation links - better touch targets */
    .section-nav .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    /* Section headers with buttons */
    .section > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .section > div:first-child > div:last-child {
        width: 100%;
    }
    
    .section > div:first-child button {
        width: 100%;
    }
    
    /* API key cards */
    .api-key-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .api-key-details {
        font-size: 0.9rem;
    }
    
    .api-key-code {
        font-size: 0.85rem;
        word-break: break-all;
        padding: 0.75rem;
        position: relative;
    }
    
    .copy-btn {
        min-height: 36px;
        min-width: 36px;
        padding: 0.5rem;
        touch-action: manipulation;
    }
    
    /* API key card buttons */
    .card > div:last-child {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card > div:last-child button {
        width: 100%;
        min-height: 44px;
    }
    
    /* IP management forms - stack on mobile */
    .card > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    
    .card > div[style*="display: flex"] > div {
        width: 100% !important;
        min-width: auto !important;
        max-width: 100% !important;
    }
    
    .card > div[style*="display: flex"] > div:last-child {
        align-self: stretch;
    }
    
    .card > div[style*="display: flex"] > div:last-child button {
        width: 100%;
    }
    
    /* Tables - make scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    table thead,
    table tbody,
    table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
    
    /* Status badges */
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Badge in whitelist count */
    .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
    
    /* Navigation links */
    .nav-links {
        display: none;
    }
    
    /* Section navigation menu */
    .section-nav {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }
    
    .section-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* Extra small devices - Phone sizes */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 1.5em;
    }
    
    .auth-card, .card {
        padding: 1.25rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Phone sizes - already centered from mobile styles above */
}

