@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    /* Professional Dark Theme */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-card: rgba(31, 31, 31, 0.7);
    --bg-card-solid: #1f1f1f;

    /* Glass Effects */
    --glass-card: rgba(26, 26, 26, 0.6);
    --glass-hover: rgba(36, 36, 36, 0.7);

    /* Subtle Accent Colors */
    --accent-primary: #4f46e5;
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    /* Borders */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.05);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Static Black Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f0f;
    pointer-events: none;
    z-index: -1;
}

/* Loading Screen */
#loader {
    position: fixed;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Container */
#loginContainer {
    display: none;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#loginContainer.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    background: var(--glass-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background: var(--glass-hover);
}

.brand-header {
    text-align: center;
    margin-bottom: 32px;
}

.brand-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: default;
}

.brand-title:hover {
    text-shadow: 0 0 20px rgba(79, 70, 229, 0.5);
    transform: scale(1.02);
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 10px 12px;
    background: rgba(26, 26, 26, 0.4);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(36, 36, 36, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 0 20px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.input-field:hover {
    border-color: rgba(79, 70, 229, 0.3);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.submit-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.submit-btn:active {
    transform: translateY(0);
}

.quick-access {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-secondary);
}

.quick-access-title {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.quick-btn {
    padding: 8px;
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.quick-btn:hover {
    background: rgba(36, 36, 36, 0.7);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.quick-btn:hover::before {
    width: 100px;
    height: 100px;
}

/* Dashboard */
#dashboard {
    display: none;
    min-height: 100vh;
}

#dashboard.active {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-primary);
    position: fixed;
    height: 100vh;
    left: 0;
    transition: left 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
    background: rgba(15, 15, 15, 0.3);
    backdrop-filter: blur(10px);
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-brand:hover {
    text-shadow: 0 0 20px rgba(79, 70, 229, 0.5);
    transform: scale(1.02);
}

.nav-section {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.nav-link:hover {
    background: rgba(36, 36, 36, 0.5);
    color: var(--text-primary);
    padding-left: 22px;
}

.nav-link:hover::after {
    transform: translateX(100%);
}

.nav-link:hover .nav-icon {
    transform: scale(1.1) translateX(2px);
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

.nav-icon {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Main Area */
.main-area {
    flex: 1;
    margin-left: 240px;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Header Bar */
.header-bar {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: all 0.3s ease;
}

.header-bar:hover {
    background: rgba(26, 26, 26, 0.8);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(36, 36, 36, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.nav-toggle:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--text-primary);
    border-color: rgba(79, 70, 229, 0.3);
    transform: scale(1.05);
}

.page-heading {
    font-size: 18px;
    font-weight: 600;
    animation: fadeInSlide 0.5s ease;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    padding: 8px 16px;
    background: rgba(36, 36, 36, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.header-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.header-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--text-primary);
    border-color: rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.header-btn:hover::before {
    width: 150px;
    height: 150px;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.logout-btn::before {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2), transparent);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.section-view {
    display: none;
}

.section-view.active {
    display: block;
    animation: contentFade 0.2s ease;
}

@keyframes contentFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.stat-card {
    background: var(--glass-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(79, 70, 229, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(79, 70, 229, 0.3);
    background: var(--glass-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover .stat-icon {
    transform: rotate(10deg) scale(1.1);
    background: rgba(79, 70, 229, 0.2);
}

.stat-trend {
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-trend {
    transform: scale(1.05);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.02);
    color: var(--accent-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.quick-stat-item {
    background: var(--glass-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-stat-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.quick-stat-item:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: var(--shadow-md), 0 0 15px rgba(79, 70, 229, 0.1);
}

.quick-stat-item:hover::after {
    opacity: 1;
}

.quick-stat-item:hover .quick-stat-icon {
    transform: scale(1.15) translateY(-2px);
}

.quick-stat-icon {
    font-size: 24px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.quick-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-primary);
}

.quick-stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* Activity Feed */
.activity-panel {
    background: var(--glass-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.activity-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-size: 10px;
    color: var(--accent-danger);
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.live-indicator:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-danger);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.create-license-btn {
    animation: subtlePulse 3s ease-in-out infinite;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(26, 26, 26, 0.4);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.activity-item:hover {
    background: rgba(36, 36, 36, 0.6);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.activity-item:hover::before {
    transform: scaleY(1);
}

.activity-item:hover .activity-icon {
    transform: scale(1.1) translateY(-2px);
}

.activity-icon {
    width: 32px;
    height: 32px;
    background: rgba(15, 15, 15, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Data Table */
.data-table {
    background: var(--glass-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.data-table:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.2);
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-btn {
    padding: 6px 12px;
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.table-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.table-btn:hover {
    background: rgba(36, 36, 36, 0.7);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.table-btn:hover::before {
    width: 100px;
    height: 100px;
}

.table-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.table-btn.primary:hover {
    background: #4338ca;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 12px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: rgba(26, 26, 26, 0.4);
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

td {
    padding: 16px 20px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-secondary);
    transition: all 0.3s ease;
}

tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
    border-left-color: var(--accent-primary);
}

tbody tr:hover td {
    background: rgba(36, 36, 36, 0.3);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateY(-50%);
    transition: left 0.6s ease;
}

tbody tr:hover .status-badge::before {
    left: 100%;
}

tbody tr:hover .status-badge {
    transform: scale(1.02);
}

.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 12px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    transform: translateX(400px);
    opacity: 0;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    animation: progress 3s linear forwards;
}

.toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast.error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.toast.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.toast.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.toast-icon {
    font-size: 28px;
    line-height: 1;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toast-message {
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.4;
}

.toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.status-suspended {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-revoked {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-expired {
    background: rgba(161, 161, 170, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(161, 161, 170, 0.3);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(31, 31, 31, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px 20px;
    display: none;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    z-index: 1000;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(79, 70, 229, 0.2);
    border-left: 3px solid var(--accent-primary);
}

.notification.show {
    display: flex;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.notify-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notify-content {
    flex: 1;
}

.notify-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.notify-message {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Buttons and forms compatibility */
.btn {
    padding: 8px 16px;
    background: rgba(36, 36, 36, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--text-primary);
    border-color: rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn.primary:hover {
    background: #4338ca;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(26, 26, 26, 0.4);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(36, 36, 36, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Prevent browser autofill from showing white/yellow background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card styling */
.card {
    background: var(--glass-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.2);
}

.card h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.grid-2-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* User Info Box (header) */
.user-info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(36, 36, 36, 0.5);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
}

.user-online-dot {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.user-email-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    padding: 2px 6px;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 3px;
    font-size: 10px;
    color: var(--accent-primary);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ==================== RESPONSIVE — TABLETS & SMALL LAPTOPS ==================== */
@media (max-width: 1024px) {
    .header-bar {
        padding: 12px 16px;
    }

    .user-email-text {
        max-width: 150px;
    }

    td, th {
        padding: 10px 12px;
    }
}

/* ==================== RESPONSIVE — MOBILE (<=768px) ==================== */
@media (max-width: 768px) {
    /* ----- Sidebar ----- */
    .sidebar {
        left: -240px;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    }

    /* Overlay behind open sidebar */
    .sidebar.open + .main-area::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 90;
        animation: fadeIn 0.2s ease;
    }

    /* ----- Main Area ----- */
    .main-area {
        margin-left: 0 !important;
    }

    /* ----- Header Bar ----- */
    .header-bar {
        padding: 10px 12px;
        gap: 8px;
    }

    .header-left {
        gap: 10px;
        min-width: 0;
        flex-shrink: 1;
    }

    .page-heading {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-toggle {
        display: flex !important;
    }

    .header-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    /* Hide email on mobile, show only role badge */
    .user-info-box {
        padding: 4px 8px;
        gap: 6px;
    }

    .user-email-text {
        display: none;
    }

    .header-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* ----- Content Area ----- */
    .content-area {
        padding: 12px;
    }

    /* ----- Header Row (breadcrumbs + action btn) ----- */
    .header-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .breadcrumbs {
        font-size: 16px;
    }

    .create-license-btn {
        width: 100%;
        text-align: center;
    }

    .btn.primary {
        width: 100%;
        text-align: center;
    }

    /* ----- Stats Grid ----- */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 10px;
    }

    .quick-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .quick-stat-item {
        padding: 10px;
    }

    .quick-stat-value {
        font-size: 15px;
    }

    /* ----- Grids ----- */
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-2-compact {
        grid-template-columns: 1fr;
    }

    /* ----- Filter forms inside data-table ----- */
    .data-table > form {
        padding: 12px;
    }

    /* ----- Tables ----- */
    .data-table {
        border-radius: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table table {
        min-width: 700px;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
        padding: 12px;
    }

    .table-title {
        font-size: 14px;
    }

    .table-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .table-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    th {
        padding: 8px 12px;
        font-size: 10px;
    }

    td {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* ----- Cards & Forms ----- */
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .card h3 {
        font-size: 14px;
    }

    .form-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .form-section {
        padding: 16px;
        margin-bottom: 12px;
    }

    .section-title {
        font-size: 15px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .row-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }

    /* ----- Toggles ----- */
    .toggles {
        grid-template-columns: 1fr;
    }

    /* ----- Chips ----- */
    .chip {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    .chip-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .chip-row {
        gap: 6px;
    }

    .chip-row .chip {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    /* ----- Buttons ----- */
    .save-button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .btn {
        font-size: 12px;
    }

    /* ----- Switch ----- */
    .switch span {
        font-size: 13px;
    }

    /* ----- Login Page ----- */
    .auth-card {
        margin: 16px;
        padding: 24px;
    }

    /* ----- Status Badges ----- */
    .status-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* ----- Activity Panel ----- */
    .activity-panel {
        padding: 14px;
    }

    .activity-list {
        max-height: 250px;
    }

    .activity-item {
        padding: 10px;
        gap: 8px;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* ----- Toast on mobile ----- */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: unset;
        max-width: 100%;
        padding: 12px 16px;
    }
}

/* ==================== RESPONSIVE — SMALL PHONES (<=480px) ==================== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .chip-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .content-area {
        padding: 8px;
    }

    .header-bar {
        padding: 8px 10px;
    }

    .page-heading {
        font-size: 13px;
    }

    .card {
        padding: 12px;
    }

    .data-table table {
        min-width: 600px;
    }

    .breadcrumbs {
        font-size: 14px;
    }

    .auth-card {
        margin: 8px;
        padding: 20px;
    }

    .brand-title {
        font-size: 20px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Utility classes */
.mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.sub {
    color: var(--text-tertiary);
    font-size: 11px;
}

.muted {
    color: var(--text-secondary);
    font-size: 12px;
}

.notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid;
}

.notice.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
    border-color: rgba(34, 197, 94, 0.3);
}

.notice.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.breadcrumbs {
    font-size: 18px;
    font-weight: 600;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.table {
    width: 100%;
}

/* Switch Toggle Styling */
.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    cursor: pointer;
}

.switch input {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 24px;
    background: #3a3a3a;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #4a4a4a;
}

.switch input:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.switch input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch input:checked::after {
    left: 20px;
}

.switch span {
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

/* Tags Input Widget - Match simple form-input style */
/* Only target div.tags (JavaScript widget), NOT input.tags (hidden original) */
div.tags {
    min-height: 42px;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #1a1a1a;
    transition: all 0.3s ease;
    width: 100%;
}

/* Keep original hidden inputs hidden */
input.tags {
    display: none !important;
}

div.tags:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

div.tags input,
input.tags-entry-input,
.tags-entry-input {
    border: none !important;
    border-width: 0px !important;
    border-style: none !important;
    flex: 1 1 auto;
    min-width: 120px;
    padding: 4px 6px;
    background: transparent !important;
    color: #ffffff !important;
    outline: none;
}

.tag {
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.4);
    padding: 6px 10px;
    border-radius: 999px;
    display: flex;
    gap: 6px;
    align-items: center;
    animation: tagFadeIn 0.2s ease;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tag b {
    font-weight: 600;
    color: var(--text-primary);
}

.tag .x {
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: bold;
    transition: all 0.2s ease;
    padding: 0 4px;
}

.tag .x:hover {
    color: var(--accent-danger);
    transform: scale(1.2);
}

div.tags.disabled {
    opacity: 0.5;
    background: #1a1a1a;
    pointer-events: none;
}

/* Chip Styling */
.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.chip {
    border: 1px solid #3a3a3a;
    background: #1a1a1a;
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    user-select: none;
}

.chip:hover {
    background: #2a2a2a;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.chip.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.chip.selected:hover {
    background: #4338ca;
}

/* Row Between */
.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Toggles Grid */
.toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

/* Short Input */
input.short {
    width: 90px !important;
    text-align: center;
}

/* Margin Top Helper */
.mt {
    margin-top: 16px;
}
