/* ----------------------------------------------------
   OFFICE LICENSE LIBRARY - PREMIUM STYLESHEET
   ---------------------------------------------------- */

:root {
    /* Color Palette - Obsidian Space Dark */
    --bg-primary: #0a0b0d;
    --bg-secondary: #0f1115;
    --bg-card: #15181f;
    --bg-card-hover: #1b1e27;
    --bg-sidebar: #07080a;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    /* Text Palette */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accent Theme Colors */
    --color-indigo: #6366f1;
    --color-indigo-glow: rgba(99, 102, 241, 0.25);
    
    --color-emerald: #10b981;
    --color-emerald-glow: rgba(16, 185, 129, 0.25);
    
    --color-sky: #0ea5e9;
    --color-sky-glow: rgba(14, 165, 233, 0.25);
    
    --color-amber: #f59e0b;
    --color-amber-glow: rgba(245, 158, 11, 0.25);
    
    --color-rose: #ef4444;
    --color-rose-glow: rgba(239, 68, 68, 0.25);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, .page-title, .section-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 32%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.14), transparent 28%),
        linear-gradient(160deg, #08090c 0%, #0d1117 100%);
}

.auth-panel {
    width: min(560px, 100%);
    background: rgba(21, 24, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.auth-brand h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-brand-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 24px;
    background: linear-gradient(135deg, var(--color-indigo), var(--color-sky));
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.28);
}

.auth-copy {
    margin-bottom: 18px;
}

.auth-copy h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.auth-copy p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .form-row {
    gap: 14px;
}

.auth-form label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-form input {
    width: 100%;
    height: 44px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.auth-form input:focus {
    border-color: var(--color-indigo);
    background-color: var(--bg-card-hover);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.08);
}

.auth-submit {
    width: 100%;
    height: 44px;
    margin-top: 4px;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ----------------------------------------------------
   SIDEBAR STYLING
   ---------------------------------------------------- */
.sidebar {
    width: 80px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    z-index: 10;
}

.logo-section {
    margin-bottom: 40px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.22), transparent 32%),
        linear-gradient(135deg, var(--color-indigo), var(--color-sky));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--color-indigo), var(--color-sky));
    z-index: -1;
    opacity: 0.28;
    filter: blur(7px);
}

.logo-letters {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.logo-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1;
}

.logo-line-bottom {
    margin-top: 1px;
    font-size: 10px;
    letter-spacing: 0.09em;
}

.logo-letters span {
    display: inline-block;
    transform-origin: center bottom;
    animation: logoLetterFloat 2.8s ease-in-out infinite;
}

.logo-line-top span:nth-child(1) {
    animation-delay: 0s;
}

.logo-line-top span:nth-child(2) {
    animation-delay: 0.12s;
    opacity: 0.85;
}

.logo-line-top span:nth-child(3) {
    animation-delay: 0.24s;
}

.logo-line-top span:nth-child(4) {
    animation-delay: 0.36s;
}

.logo-line-bottom span:nth-child(1) {
    animation-delay: 0.48s;
}

.logo-line-bottom span:nth-child(2) {
    animation-delay: 0.6s;
}

.logo-line-bottom span:nth-child(3) {
    animation-delay: 0.72s;
}

.logo-icon:hover .logo-letters span {
    animation-duration: 1.6s;
}

@keyframes logoLetterFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }
    50% {
        transform: translateY(-4px) scale(1.05);
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.16));
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.nav-item {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--color-indigo);
    background-color: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 13px;
    height: 20px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background-color: var(--color-indigo);
    box-shadow: 0 0 10px var(--color-indigo);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-item.logout:hover {
    color: var(--color-rose);
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

/* ----------------------------------------------------
   MAIN CONTENT AREA
   ---------------------------------------------------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 40px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.03), transparent 60%);
}

/* ----------------------------------------------------
   HEADER SECTION
   ---------------------------------------------------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 26px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

/* Dynamic Search Bar */
.search-bar {
    position: relative;
    width: 320px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-bar input {
    width: 100%;
    height: 42px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 48px 0 38px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-normal);
}

.search-bar input:focus {
    border-color: var(--color-indigo);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.08);
    background-color: var(--bg-card);
}

.search-bar input:focus + .search-icon {
    color: var(--color-indigo);
}

.shortcut-hint {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-family: inherit;
    font-weight: 500;
}

/* Action button items */
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-fast);
    position: relative;
}

.icon-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-card);
    border-color: var(--border-color-hover);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--color-amber);
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 9px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Profile Card */
.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 14px 4px 6px;
    border-radius: 14px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.profile-card:hover {
    background-color: var(--bg-card);
    border-color: var(--border-color-hover);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(14, 165, 233, 0.22));
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.profile-role {
    font-size: 10px;
    color: var(--text-muted);
}

.profile-arrow {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ----------------------------------------------------
   BACKUP PANEL STYLING
   ---------------------------------------------------- */
.backup-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
    max-height: 120px;
    opacity: 1;
    overflow: hidden;
}

.backup-panel.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
    border-color: transparent;
    pointer-events: none;
}

.backup-panel h3 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.backup-panel h3 i {
    color: var(--color-indigo);
    margin-right: 6px;
}

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

.storage-status {
    display: inline-flex;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

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

/* ----------------------------------------------------
   DATABASE MAIN SECTION
   ---------------------------------------------------- */
.database-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(21, 24, 31, 0.8) 100%);
    backdrop-filter: blur(12px);
}

.view-hidden {
    display: none !important;
}

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

.section-title {
    font-size: 18px;
    color: var(--text-primary);
}

.database-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Filters */
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group label i {
    font-size: 11px;
    color: var(--text-muted);
}

.filter-select {
    height: 38px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    padding: 0 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--border-color-hover);
}

.filter-select:focus {
    border-color: var(--color-indigo);
}

/* Generic Buttons Styling */
.btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: #5558eb;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--color-rose);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 8px;
}

.status-pill-role {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--color-indigo);
    border: 1px solid rgba(99, 102, 241, 0.16);
}

/* ----------------------------------------------------
   LICENSE DATABASE TABLE
   ---------------------------------------------------- */
.table-container {
    overflow-x: auto;
    flex: 1;
    position: relative;
    min-height: 250px;
}

.license-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.license-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.license-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.license-table tr {
    transition: var(--transition-fast);
}

.license-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.sales-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    flex: 1;
}

.sales-tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(15, 17, 21, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: fit-content;
}

.sales-tab-btn {
    height: 34px;
    min-width: 98px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.sales-tab-btn:hover {
    color: var(--text-primary);
}

.sales-tab-btn.active {
    background: var(--color-indigo);
    color: #fff;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.2);
}

.toner-tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(15, 17, 21, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: fit-content;
}

.toner-tab-btn {
    height: 34px;
    min-width: 120px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.toner-tab-btn:hover {
    color: var(--text-primary);
}

.toner-tab-btn.active {
    background: var(--color-indigo);
    color: #fff;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.2);
}

.toner-panels {
    min-height: 0;
    flex: 1;
}

.toner-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(10, 11, 13, 0.16);
    overflow: hidden;
}

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

.toner-supply-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 42px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.toner-supply-item-row select,
.toner-supply-item-row input {
    width: 100%;
    height: 40px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-primary);
    font-size: 13px;
}

.toner-supply-item-row select:focus,
.toner-supply-item-row input:focus {
    border-color: var(--color-indigo);
    background-color: var(--bg-card-hover);
}

.toner-supply-remove-btn {
    width: 42px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toner-supply-remove-btn:hover {
    color: var(--color-rose);
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.toner-model-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.toner-model-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    font-size: 12px;
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.sales-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(10, 11, 13, 0.16);
    overflow: hidden;
}

.sales-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.sales-panel-header h3 {
    font-size: 14px;
    color: var(--text-primary);
}

.sales-panel-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-indigo);
    font-size: 11px;
    font-weight: 700;
}

.sales-panel-count-muted {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
}

.sales-panel .table-container {
    min-height: 0;
}

.sales-panel .empty-state {
    min-height: 260px;
}

/* License Name Column */
.license-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.version-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.1;
    font-size: 9px;
}

.version-badge-2024 {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.version-badge-365 {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--color-sky);
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.version-badge-2021 {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-indigo);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.version-badge-2019 {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.version-badge-2016 {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-rose);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.version-badge-2013 {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.badge-text-top {
    font-size: 8px;
    font-weight: 500;
    opacity: 0.8;
}
.badge-text-val {
    font-size: 12px;
}

.license-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.license-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13.5px;
}

.license-notes-sub {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Key Column */
.key-cell-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-masked {
    font-family: 'SFMono-Regular', Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12.5px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.copy-key-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 12px;
}

.copy-key-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.copy-key-btn.success {
    color: var(--color-emerald) !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* User Column */
.user-cell {
    display: flex;
    align-items: center;
}

.user-cell-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 450;
    color: var(--text-primary);
}

.user-locality {
    font-size: 11px;
    color: var(--text-muted);
}

/* Status Capsules */
.status-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 550;
    line-height: 1;
}

.status-pill-free {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-pill-available {
    background-color: rgba(14, 165, 233, 0.08);
    color: var(--color-sky);
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.status-pill-taken {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-pill-expiring {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-pill-expired {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--color-rose);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Expiry indicator glow */
.row-warning {
    position: relative;
}
.row-warning::after {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background-color: var(--color-amber);
    border-radius: 0 2px 2px 0;
}

.row-danger {
    position: relative;
}
.row-danger::after {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background-color: var(--color-rose);
    border-radius: 0 2px 2px 0;
}

.text-right {
    text-align: right !important;
}

.actions-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.row-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.row-action-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.row-action-btn.edit-btn:hover {
    color: var(--color-indigo);
    background-color: rgba(99, 102, 241, 0.08);
}

.row-action-btn.delete-btn:hover {
    color: var(--color-rose);
    background-color: rgba(239, 68, 68, 0.08);
}

/* Empty State Styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    width: 100%;
}

.empty-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 320px;
    margin-bottom: 16px;
}

.hidden {
    display: none !important;
}

/* ----------------------------------------------------
   MODAL DIALOG DIALOGS
   ---------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.12), transparent 32%),
        rgba(4, 6, 9, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    animation: fadeIn var(--transition-fast) forwards;
}

.modal-container {
    width: 580px;
    max-width: 90vw;
    max-height: calc(100vh - 48px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 50px rgba(99, 102, 241, 0.05);
    overflow: hidden;
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-container-sm {
    width: 520px;
}

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

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

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

/* Modals Forms */
#license-form,
#user-form,
#sale-form,
#toner-model-form,
#toner-supply-form,
#setup-form,
#change-password-form {
    padding: 24px 28px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-6, .col-4 {
    flex: 1;
}

#license-form label,
#user-form label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

#license-form input[type="text"],
#license-form input[type="password"],
#user-form input[type="text"],
#user-form input[type="password"],
#license-form input[type="email"],
#user-form input[type="email"],
#license-form input[type="date"],
#user-form select,
#license-form select,
#license-form textarea,
#user-form textarea {
    height: 40px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 14px;
    color: var(--text-primary);
    font-size: 13.5px;
    transition: var(--transition-fast);
}

#license-form textarea {
    height: auto;
    padding: 10px 14px;
    resize: none;
}

#user-form textarea {
    height: auto;
    padding: 10px 14px;
    resize: none;
}

.serial-number-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.serial-number-wrapper input {
    flex: 1;
    min-width: 0;
}

.serial-copy-btn {
    flex-shrink: 0;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#license-form input:focus,
#user-form input:focus,
#license-form select:focus,
#license-form textarea:focus,
#user-form textarea:focus {
    border-color: var(--color-indigo);
    background-color: var(--bg-card-hover);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.08);
}

.user-directory-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-directory-notes {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-helper {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -2px;
}

.key-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.key-input-wrapper input {
    width: 100%;
    padding-right: 40px !important;
    font-family: 'SFMono-Regular', Consolas, monospace;
    letter-spacing: 0.5px;
}

.security-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition-fast);
}

/* Validation colors */
.key-input-wrapper.valid input {
    border-color: var(--color-emerald) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.08);
}
.key-input-wrapper.valid .security-icon {
    color: var(--color-emerald);
}

.key-input-wrapper.invalid input {
    border-color: var(--color-rose) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.08);
}
.key-input-wrapper.invalid .security-icon {
    color: var(--color-rose);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

/* ----------------------------------------------------
   DYNAMIC TOAST NOTIFICATIONS
   ---------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    min-width: 280px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.toast-icon {
    font-size: 16px;
}

.toast-message {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.toast-success {
    border-left: 4px solid var(--color-emerald);
}
.toast-success .toast-icon {
    color: var(--color-emerald);
}

.toast-info {
    border-left: 4px solid var(--color-sky);
}
.toast-info .toast-icon {
    color: var(--color-sky);
}

.toast-warning {
    border-left: 4px solid var(--color-amber);
}
.toast-warning .toast-icon {
    color: var(--color-amber);
}

.toast-error {
    border-left: 4px solid var(--color-rose);
}
.toast-error .toast-icon {
    color: var(--color-rose);
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN BREAKPOINTS
   ---------------------------------------------------- */
@media (max-width: 900px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .search-bar {
        width: 100%;
        max-width: 280px;
    }
    .sales-grid {
        grid-template-columns: 1fr;
    }
    .toner-tabs {
        width: 100%;
    }
    .toner-tab-btn {
        flex: 1;
        min-width: 0;
    }
    .toner-supply-item-row {
        grid-template-columns: 1fr;
    }
    .toner-supply-remove-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .auth-shell {
        padding: 18px;
    }
    .auth-panel {
        padding: 24px 20px;
    }
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-between;
        padding: 0 20px;
    }
    .logo-section {
        margin-bottom: 0;
    }
    .sidebar-nav {
        flex-direction: row;
        gap: 12px;
        flex: none;
    }
    .sidebar-footer {
        flex-direction: row;
    }
    .nav-item.active::before {
        display: none;
    }
    .main-content {
        padding: 20px;
    }
    .database-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .database-controls {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }
    .filter-group {
        width: 100%;
    }
    .filter-select {
        flex: 1;
    }
    .btn-primary {
        width: 100%;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .modal-backdrop {
        padding: 16px;
        align-items: flex-start;
    }
    .modal-container {
        max-width: 100%;
        max-height: none;
        margin: auto 0;
    }
    .serial-number-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .serial-copy-btn {
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 0 14px;
    }
    #license-form {
        max-height: none;
    }
}
