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

/* Base Variables & Reset */
:root {
    --bg-dark: #0f172a;           /* slate-900 */
    --bg-darker: #020617;         /* slate-950 */
    --card-bg: #1e293b;           /* slate-800 */
    --card-border: #334155;       /* slate-700 */
    --primary: #10b981;           /* emerald-500 */
    --primary-hover: #059669;     /* emerald-600 */
    --secondary: #3b82f6;         /* blue-500 */
    --text-main: #f8fafc;         /* slate-50 */
    --text-muted: #94a3b8;        /* slate-400 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    /* Font Sizes Normalization - Premium Scale (16px base) */
    --fs-xs: 0.875rem;   /* 14px */
    --fs-sm: 0.9375rem;  /* 15px */
    --fs-base: 1rem;     /* 16px */
    --fs-md: 1.125rem;   /* 18px */
    --fs-lg: 1.25rem;    /* 20px */
    --fs-xl: 1.5rem;     /* 24px */
}

.hidden { display: none !important; }

/* Utility Classes */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.h-screen { height: 100vh !important; }
.flex { display: flex !important; }
.flex-col { display: flex !important; flex-direction: column !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.cursor-pointer { cursor: pointer !important; }
.overflow-hidden { overflow: hidden !important; }
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}


.mb-10 { margin-bottom: 10px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mt-10 { margin-top: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-25 { margin-top: 25px !important; }
.pl-20 { padding-left: 20px !important; }

.grid-1col { grid-template-columns: 1fr !important; }
.fs-xs-tag { font-size: 0.7rem !important; }
.line-height-12 { line-height: 1.2 !important; }

.user-border-primary { border: 2px solid var(--primary) !important; }
.btn-h-50 { height: 50px !important; }
.w-80 { width: 80px !important; }
.gap-15 { gap: 15px !important; }
.btn-fit { height: fit-content !important; padding: 10px 20px !important; }
.max-w-400 { max-width: 400px !important; }
.gap-10 { gap: 10px !important; }
.fs-09 { font-size: 0.9rem !important; }
.fs-08 { font-size: 0.8rem !important; }
.gap-5 { gap: 5px !important; }
.flex-wrap { flex-wrap: wrap !important; }
.text-muted-class { color: var(--text-muted) !important; }
.m-0 { margin: 0 !important; }

/* Grid & Layout Utilities */
.grid { display: grid !important; }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
.gap-20 { gap: 20px !important; }

.col-span-12 { grid-column: span 12 / span 12 !important; }
.col-span-11 { grid-column: span 11 / span 11 !important; }
.col-span-10 { grid-column: span 10 / span 10 !important; }
.col-span-9 { grid-column: span 9 / span 9 !important; }
.col-span-8 { grid-column: span 8 / span 8 !important; }
.col-span-7 { grid-column: span 7 / span 7 !important; }
.col-span-6 { grid-column: span 6 / span 6 !important; }
.col-span-5 { grid-column: span 5 / span 5 !important; }
.col-span-4 { grid-column: span 4 / span 4 !important; }
.col-span-3 { grid-column: span 3 / span 3 !important; }

@media (min-width: 769px) {
    .md\:col-span-12 { grid-column: span 12 / span 12 !important; }
    .md\:col-span-6 { grid-column: span 6 / span 6 !important; }
    .md\:col-span-5 { grid-column: span 5 / span 5 !important; }
    .md\:col-span-7 { grid-column: span 7 / span 7 !important; }
}

@media (min-width: 1025px) {
    .lg\:col-span-12 { grid-column: span 12 / span 12 !important; }
    .lg\:col-span-6 { grid-column: span 6 / span 6 !important; }
    .lg\:col-span-5 { grid-column: span 5 / span 5 !important; }
    .lg\:col-span-7 { grid-column: span 7 / span 7 !important; }
}

/* Responsive Utilities */
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
}

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

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    overflow-x: hidden;
}

/* ===== ZIMMET TUTANAĞI - PREMIUM PRINT STYLES ===== */

/* Screen: hide the protocol block */
.print-protocol { display: none; }

@media print {
    /* Hard isolation */
    body > *:not(#print-preview-modal) {
        display: none !important;
    }

    body {
        background: #fff !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    #print-preview-modal {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: #fff !important;
        overflow: visible !important;
    }

    #print-preview-modal .modal-content {
        display: block !important;
        width: 100% !important;
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    #print-preview-modal .modal-content > div:first-child {
        display: none !important;
    }

    #preview-scroll-area {
        overflow: visible !important;
        max-height: none !important;
        width: 100% !important;
    }

    #print-protocol {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #1e293b !important;
        font-family: 'Inter', sans-serif !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        overflow: visible !important;
    }

    #print-protocol .pp-header-bar {
        padding: 16px 20px !important;
        background: linear-gradient(135deg, #1e293b 0%, #0f4c81 100%) !important;
        color: #fff !important;
        display: flex !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Fix for white text in print */
    #print-protocol .pp-header-bar *,
    #print-protocol .pp-section-title,
    #print-protocol .pp-section-title *,
    #print-protocol .pp-sign-label {
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #print-protocol .pp-parties {
        display: flex !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid !important;
    }

    #print-protocol .pp-product-table tr {
        page-break-inside: avoid !important;
    }

    #print-protocol .pp-terms-box {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-top: 20px !important;
    }

    #print-protocol .pp-signatures {
        display: flex !important;
        gap: 20px !important;
        margin-top: 30px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        overflow: visible !important;
    }

    #print-protocol .pp-sign-col {
        flex: 1 !important;
        border: 1px solid #cbd5e1 !important;
        page-break-inside: avoid !important;
        visibility: visible !important;
        display: block !important;
    }

    #print-protocol .pp-sign-box-area {
        height: auto !important;
        min-height: 80px !important;
        background: #fff !important;
    }

    #print-protocol .pp-footer {
        margin-top: 30px !important;
        page-break-inside: avoid !important;
    }

    @page { 
        size: A4; 
        margin: 15mm;
    }

    .btn, .close-btn, .scanner-fab { display: none !important; }
}

/* --- Header Bar --- */
#print-protocol .pp-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f4c81 100%);
    color: #fff;
    padding: 18px 24px;
    margin-bottom: 0;
    border-radius: 4px 4px 0 0;
}
#print-protocol .pp-company-block {
    display: flex; align-items: center; gap: 14px;
}
#print-protocol .pp-company-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
#print-protocol .pp-company-name {
    font-size: 1rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
#print-protocol .pp-company-sub {
    font-size: 0.72rem; opacity: 0.75; margin-top: 2px; letter-spacing: 0.5px;
}
#print-protocol .pp-doc-info { text-align: right; }
#print-protocol .pp-doc-title {
    font-size: 1.15rem; font-weight: 900; letter-spacing: 2px;
    text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 6px; margin-bottom: 6px;
}
#print-protocol .pp-doc-meta {
    display: flex; gap: 18px; justify-content: flex-end;
    font-size: 0.75rem; opacity: 0.85;
}

/* --- Alert Band --- */
#print-protocol .pp-alert-band {
    background: #fff3cd;
    border-left: 5px solid #f59e0b;
    border-right: 5px solid #f59e0b;
    padding: 9px 16px;
    font-size: 0.78rem;
    color: #7c4f00;
    display: flex; align-items: center; gap: 10px;
    font-style: italic;
}
#print-protocol .pp-alert-band i { font-size: 1rem; color: #d97706; flex-shrink: 0; }

/* --- Parties --- */
#print-protocol .pp-parties {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1.5px solid #cbd5e1;
    border-top: none;
    margin-bottom: 18px;
}
#print-protocol .pp-party-box {
    flex: 1;
    padding: 14px 18px;
}
#print-protocol .pp-party-left { background: #f8fafc; border-right: 1px dashed #94a3b8; }
#print-protocol .pp-party-right { background: #f0f9ff; }
#print-protocol .pp-party-arrow {
    display: flex; align-items: center; justify-content: center;
    padding: 0 10px;
    font-size: 1.6rem; color: #64748b;
    background: #e2e8f0;
}
#print-protocol .pp-party-title {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 1.5px;
    text-transform: uppercase; color: #0f4c81;
    border-bottom: 1.5px solid #0f4c81;
    padding-bottom: 5px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
#print-protocol .pp-party-field {
    display: flex; gap: 0; margin-bottom: 5px; font-size: 0.82rem;
    border-bottom: 1px dotted #cbd5e1; padding-bottom: 3px;
}
#print-protocol .pp-field-label {
    min-width: 100px; color: #64748b; font-size: 0.75rem; font-weight: 600;
    padding-right: 8px;
}
#print-protocol .pp-field-value {
    flex: 1; font-weight: 700; color: #0f172a;
}

/* --- Section Title --- */
#print-protocol .pp-section-title {
    background: #1e293b;
    color: #fff;
    padding: 7px 14px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 0;
}

/* --- Product Table --- */
#print-protocol .pp-product-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    font-size: 0.82rem;
}
#print-protocol .pp-product-table th {
    background: #e2e8f0;
    color: #374151;
    padding: 8px 10px;
    border: 1px solid #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}
#print-protocol .pp-product-table td {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    vertical-align: middle;
}
#print-protocol .pp-product-table tr:nth-child(even) td {
    background: #f8fafc;
}
#print-protocol .pp-product-table .pp-serial-code {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #bfdbfe;
}

/* --- Terms Box --- */
#print-protocol .pp-terms-box {
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}
#print-protocol .pp-terms-title {
    background: #f1f5f9;
    padding: 7px 14px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; gap: 8px;
}
#print-protocol .pp-terms-list {
    margin: 10px 14px 12px 30px;
    padding: 0;
    font-size: 0.78rem;
    color: #374151;
    line-height: 1.7;
}
#print-protocol .pp-terms-list li { margin-bottom: 3px; }
#print-protocol .pp-terms-list li strong { color: #b91c1c; }

/* --- Signatures --- */
#print-protocol .pp-signatures {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}
#print-protocol .pp-sign-col {
    flex: 1;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    text-align: center;
}
#print-protocol .pp-sign-label {
    background: #1e293b;
    color: #fff;
    padding: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}
#print-protocol .pp-sign-name-line {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    padding: 8px 10px 2px;
    border-bottom: 1px dashed #cbd5e1;
}
#print-protocol .pp-sign-role {
    font-size: 0.72rem;
    color: #64748b;
    padding: 3px 10px 6px;
    border-bottom: 1px solid #e2e8f0;
}
#print-protocol .pp-sign-box-area {
    height: 70px;
    background: #fafafa;
    border-bottom: 1.5px solid #334155;
    margin: 8px 14px 0;
}
#print-protocol .pp-sign-sub {
    font-size: 0.65rem;
    color: #94a3b8;
    padding: 3px 10px;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: 0.5px;
}
#print-protocol .pp-sign-date-line {
    font-size: 0.72rem;
    color: #374151;
    padding: 5px 10px 8px;
}

/* --- Footer --- */
#print-protocol .pp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #1e293b;
    padding-top: 6px;
    font-size: 0.65rem;
    color: #94a3b8;
    font-style: italic;
}

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

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0 !important;
        transform: translateX(-100%) !important;
        z-index: 10000 !important;
    }
    .sidebar.open, body.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }
}

.sidebar-header {
    height: 100px; /* Slightly taller for more breath */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
    position: relative;
    overflow: hidden;
}

/* Tech-Grid Background Pattern */
.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
    background-size: 12px 12px;
    opacity: 0.4;
    pointer-events: none;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.4), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    background: #020617;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    animation: sidebarLogoPulse 4s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo:hover .logo-icon-wrap {
    transform: rotate(-5deg) scale(1.08);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

@keyframes sidebarLogoPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05); border-color: rgba(16, 185, 129, 0.3); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.08); border-color: rgba(16, 185, 129, 0.5); }
}

.logo-img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 6px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-brand {
    font-size: 1.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.1;
    filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.2));
    transition: all 0.3s ease;
}

.logo:hover .logo-brand {
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}

.logo-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 2px;
}

.logo-version {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    line-height: 1.3;
}

/* ============================================
   SIDEBAR NAVIGATION - HIGH-END POLISH
   ============================================ */
.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Base item container */
.nav-links > li {
    margin: 4px 14px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shared style for link contents and dropdown headers */
.nav-links > li:not(.has-submenu),
.submenu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    width: 100%;
    transition: all 0.2s ease;
    border-radius: 12px;
}

/* Icon Uniformity */
.nav-links li i:not(.chevron) {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.7;
}

/* Hover States */
.nav-links > li:not(.active):not(.has-submenu):hover,
.has-submenu:not(.open) .submenu-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-links li:hover i:not(.chevron) {
    color: var(--primary);
    opacity: 1;
}

/* Active Indicator (Vertical Bar) - Responsive & Precise */
.nav-links > li.active:not(.has-submenu)::before,
.has-submenu.active::before,
.has-submenu.open::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    z-index: 5;
}

/* Parent Active Highlight (when a child is selected) */
.has-submenu.active .submenu-header {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

/* Level 1 Active Text/Icon */
.nav-links > li.active:not(.has-submenu) {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    color: var(--primary);
    font-weight: 700;
}

.nav-links > li.active i:not(.chevron) {
    color: var(--primary);
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.3));
}

/* Dropdown Header Logic */
.has-submenu.active .submenu-header,
.has-submenu.open .submenu-header {
    color: #fff;
    font-weight: 600;
}

.submenu-header .chevron {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0.4;
}

.has-submenu.open .chevron,
.has-submenu.active .chevron {
    transform: rotate(180deg);
    color: var(--primary);
    opacity: 1;
}

/* Submenu Container - Sophisticated Plate */
.submenu {
    list-style: none;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    max-height: 0;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 4px 12px 12px;
    border-radius: 12px;
    border-left: 2px solid rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(4px);
}

.has-submenu.open .submenu,
.has-submenu.active .submenu {
    max-height: 800px;
    padding: 8px 0;
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.4);
}

/* Specific Active Case for Top-Level while Submenu is Open */
.has-submenu.open {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
    margin-bottom: 6px;
    border-radius: 12px;
}

.has-submenu.open .submenu-header {
    color: #fff;
    font-weight: 700;
}

/* Submenu Item Styles - Deeply Polished */
.submenu li {
    margin: 1px 12px !important;
    padding: 10px 16px !important;
    font-size: 0.84rem !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, 0.45) !important;
    transition: all 0.25s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative;
    background: transparent !important;
    font-weight: 500;
}

.submenu li:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    transform: translateX(6px);
}

.submenu li.active-sub {
    color: #fff !important;
    font-weight: 700 !important;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.02) 100%) !important;
}

.submenu li.active-sub::before {
    content: '';
    position: absolute;
    left: -14px; /* Perfectly aligned to the parent's guide-line */
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary);
    top: 50%;
    transform: translateY(-50%);
}


/* Divider Upgrade */
.menu-divider {
    padding: 25px 25px 10px !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.2) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.05);
}
.sidebar-user {
    padding: 16px 20px;
    margin: 10px 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-user-name-text { 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: var(--text-main);
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.nav-user-role-text { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    font-weight: 500;
}
.header-user-name-text { font-size: var(--fs-md); font-weight: 700; }
.header-user-role-text { font-size: var(--fs-sm); color: var(--text-muted); }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top left, #1e293b, var(--bg-darker));
}

.top-header {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0 32px;
    height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100vw;
}


.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mobile-menu-btn i {
    font-size: 1.25rem;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex !important;
    }
}

.header-title h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    margin: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 6px 6px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-avatar-nav {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

#btn-logout-top {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.2s;
}

#btn-logout-top:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--fs-sm);
}

.content-wrapper {
    padding: 30px;
    max-width: 1600px; /* Increased for wider screens */
    margin: 0 auto;
    width: 100%;
}

.page-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page-section.active-section {
    display: block;
}

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

/* Cards & Grid */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px; /* Reduced padding from 30px */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.card h2 {
    font-size: var(--fs-md); /* Reduced from xl */
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.card h2 i {
    color: var(--primary);
    font-size: 1.4rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-bottom: 20px;
}

/* Filter Buttons */
.inventory-filters {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #334155;
    color: white;
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #475569;
}

.filter-btn.active, .filter-btn.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}


/* ============================================
   DASHBOARD - PREMIUM REDESIGN
   ============================================ */

/* Welcome Banner */
.dash-welcome {
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}
.dash-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.dash-welcome-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.dash-welcome-text h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
    border: none;
    padding: 0;
}
.dash-welcome-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.dash-welcome-date {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.dash-welcome-date i {
    color: var(--primary);
}

/* Stats Grid - Premium */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 18px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    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;
    height: 3px;
    border-radius: 14px 14px 0 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.stat-card--primary::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card--warning::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card--success::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card--danger::before  { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}
.stat-card:hover::before { opacity: 1; }

.stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon-wrap.primary { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.stat-icon-wrap.warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.stat-icon-wrap.success { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.stat-icon-wrap.danger  { background: rgba(239, 68, 68, 0.12); color: #f87171; }

.stat-trend {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.stat-trend--neutral {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.stat-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.5px;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-card-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.primary-bar { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.warning-bar { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.success-bar { background: linear-gradient(90deg, #10b981, #34d399); }
.danger-bar  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

/* Dashboard Cards */
.dash-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.dash-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dash-card-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dash-card-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}
.dash-card-title p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}
.dash-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.dash-card-icon.accent {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.dash-link-btn {
    background: none;
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.dash-link-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateX(2px);
}
.dash-link-btn i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}
.dash-link-btn:hover i {
    transform: translateX(3px);
}

.dash-card-body {
    padding: 16px 22px 20px;
}

/* Dashboard Table */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.dash-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dash-table tbody td {
    padding: 12px 14px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}
.dash-table tbody tr:last-child td {
    border-bottom: none;
}
.dash-table tbody tr {
    transition: background 0.15s ease;
}
.dash-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.dash-table code {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Quick Action Grid */
.qa-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qa-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    color: inherit;
    font-family: inherit;
    width: 100%;
}
.qa-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.qa-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.qa-card:hover .qa-card-icon {
    transform: scale(1.08);
}

/* Quick Action Icon Colors */
.qa-purchase .qa-card-icon { background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15)); color: #60a5fa; }
.qa-assign .qa-card-icon   { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.15)); color: #34d399; }
.qa-personnel .qa-card-icon { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.15)); color: #fbbf24; }
.qa-reports .qa-card-icon  { background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(192, 132, 252, 0.15)); color: #c084fc; }

.qa-card-content {
    flex: 1;
    min-width: 0;
}
.qa-card-content h4 {
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--text-main);
    margin-bottom: 2px;
}
.qa-card-content p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.qa-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.qa-card:hover .qa-arrow {
    opacity: 0.7;
    transform: translateX(0);
}

/* Dashboard Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .dash-welcome-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .dash-welcome {
        padding: 18px 20px;
    }
    .stat-card {
        padding: 14px 16px 12px;
    }
    .stat-value {
        font-size: 1.4rem;
    }
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
}



/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Reduced min-width */
    gap: 15px; /* Reduced from 20px */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reduced from 8px */
}

.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

label i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

.radio-label {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Custom Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

.radio-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

input, select {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    padding: 7px 14px; /* More compact */
    border-radius: 6px;
    border: none;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

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

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

.btn-danger:hover { background-color: #dc2626; }

.btn-sm {
    padding: 6px 12px;
    font-size: var(--fs-xs);
}

.btn-action {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.9rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-orange { background: #f59e0b; color: white; }
.btn-orange:hover { background: #d97706; }

.btn-gray { background: #e2e8f0; color: #1e293b; }
.btn-gray:hover { background: #cbd5e1; }

.btn-secondary { background: #6366f1; color: white; }
.btn-secondary:hover { background: #4f46e5; }

.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }

.btn-icon {
    background-color: var(--card-border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.card-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

.card-header-clean h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.btn-text {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--primary);
    text-decoration: underline;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.qa-btn {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: var(--text-main);
}

.qa-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.qa-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.1);
    background: rgba(30, 41, 59, 0.8);
}

.qa-btn:hover::before { opacity: 1; }

.qa-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: all 0.3s;
}

.qa-purchase .qa-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.qa-assign .qa-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.qa-personnel .qa-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.qa-reports .qa-icon { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.qa-btn:hover .qa-icon {
    transform: scale(1.1);
}

.qa-text {
    flex: 1;
}

.qa-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-main);
}

.qa-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.3;
}

.minimalist-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.minimalist-table tr td {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.minimalist-table tr td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.minimalist-table tr td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Serial Inputs Area */
.hidden { display: none !important; }

.serial-numbers-container hr {
    border: 0;
    height: 1px;
    background-color: var(--card-border);
    margin: 30px 0 20px;
}

.serial-numbers-container h3 {
    margin-bottom: 20px;
    color: var(--primary);
}

.serial-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* More compact columns */
    gap: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

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

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

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}

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

.serial-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-dark);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.serial-input-wrapper span {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 25px;
}

.serial-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 5px;
}
.serial-input-wrapper input:focus { box-shadow: none; border-bottom: 1px solid var(--primary); border-radius: 0; }

/* Tables */
.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0 12px;
    height: 36px; /* Explicit compact height */
    width: 300px;
}

.search-box i { color: var(--text-muted); }
.search-box input {
    border: none;
    background: transparent;
    margin-left: 10px;
    width: 100%;
    font-size: var(--fs-sm);
}
.search-box input:focus { box-shadow: none; }

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th, .data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    font-size: var(--fs-sm);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-darker);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table tr:hover { background-color: rgba(255, 255, 255, 0.03); }

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-assigned { background-color: rgba(59, 130, 246, 0.15); color: var(--secondary); border: 1px solid rgba(59,130,246,0.3); }
.badge-inservice { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* Badge Animations */
.badge-instock {
    animation: pulse-green 3s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.data-table tr {
    transition: all 0.2s;
}

.data-table tr:hover td {
    color: white;
}

/* History Tags */
.tag-gray { background: #475569; color: #f8fafc; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; }
.tag-green { background: #065f46; color: #34d399; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; border: 1px solid #059669; }
.tag-blue { background: #1e3a8a; color: #93c5fd; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; border: 1px solid #3b82f6; }
.tag-orange { background: #7c2d12; color: #fb923c; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; border: 1px solid #ea580c; }
.tag-red { background: #7f1d1d; color: #fca5a5; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; border: 1px solid #ef4444; }
.tag-purple { background: #581c87; color: #d8b4fe; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; border: 1px solid #a855f7; }

/* Modal / Scanner */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover { color: white; }

#reader {
    width: 100%;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
}

.notification {
    background-color: #1e293b;
    border-left: 4px solid var(--primary);
    color: white;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease forwards;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.error { border-color: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; display: none; }
}

/* Assignment Redesign - Glassmorphism & High End UI */
.assign-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 25px;
    align-items: start;
}

.asset-selection-card {
    height: 650px;
    display: flex;
    flex-direction: column;
}

.asset-table-wrapper {
    flex: 1;
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.4);
}

.asset-table-wrapper table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card-bg);
}

.data-table tr.active-row {
    background: rgba(16, 185, 129, 0.2) !important;
    border-left: 4px solid var(--primary);
}

.assignment-details-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #1e1b4b 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.type-switch-container {
    background: var(--bg-darker);
    padding: 5px;
    border-radius: 12px;
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border: 1px solid var(--card-border);
    flex-wrap: wrap; /* Wrap on small screens */
}

.type-switch-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
    color: var(--text-muted);
}

.type-switch-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.assign-summary-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.assign-summary-box span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.assign-summary-box strong {
    font-size: 1.2rem;
    color: var(--primary);
}
@media (max-width: 768px) {
    body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        width: 100%;
        max-width: 100vw;
        display: block; 
        overflow-x: hidden;
    }

    .main-content {
        width: 100%;
        max-width: 100vw;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .top-header {
        padding: 0 10px;
        height: 64px;
        min-height: 64px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        justify-content: space-between !important;
    }

    .header-title {
        flex: 1;
        margin-left: 10px;
        min-width: 0;
    }

    .header-title h1 {
        font-size: 1.1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .header-user-info {
        display: none !important;
    }

    .header-user {
        gap: 8px !important;
        padding: 4px !important;
        background: transparent !important;
        border: none !important;
    }

    .mobile-menu-btn { 
        display: flex !important; 
        align-items: center;
        justify-content: center;
        z-index: 101;
    }
    
    .sidebar {
        z-index: 10000 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transform: translateX(-100%) !important;
        left: 0 !important;
    }
    
    body.sidebar-open .sidebar, .sidebar.open {
        transform: translateX(0) !important;
    }

    .card h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .search-box { width: 100%; }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-actions { 
        display: flex; 
        flex-direction: column; 
        width: 100%;
    }

    .assign-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px;
        width: 100% !important;
        box-sizing: border-box;
        padding: 0; /* Remove side padding to fit screen edges better */
    }

    .asset-selection-card {
        height: auto !important;
        max-height: 80vh;
        order: 2; /* Form on top, asset table below */
    }

    .assignment-details-card {
        order: 1; /* Form first on mobile for better flow */
    }

    .asset-table-wrapper {
        border: none;
        background: transparent;
        overflow-x: hidden;
    }

    .serial-inputs-grid {
        grid-template-columns: 1fr;
        max-height: none; /* No internal scroll on mobile, use main page scroll */
        overflow-y: visible;
        padding-right: 0;
        gap: 12px;
    }

    .serial-input-wrapper {
        padding: 6px 10px;
        gap: 8px;
    }

    .serial-input-wrapper input {
        font-size: 14px;
        min-width: 0; /* Important for flex shrink */
    }

    .serial-input-wrapper .btn-icon {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    /* Table Fixes for Mobile */
    .data-table th, .data-table td {
        padding: 8px 10px;
        font-size: var(--fs-xs);
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
        max-height: 98vh; /* Maximize usable space */
    }

    #reader {
        width: 100% !important;
        margin-top: 10px;
    }

    /* Fix for some mobile browsers that might experience horizontal overflow */
    .app-container, .main-content {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Responsive Overrides ve Mobil İyileştirmeler */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    .sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0 !important;
        transform: translateX(-100%) !important;
        z-index: 10000 !important;
    }
    .sidebar.open, body.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 12px !important;
    }

    .dash-welcome-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dash-welcome-date {
        align-self: flex-start;
    }

    .content-wrapper {
        padding: 10px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    .card {
        padding: 15px !important;
        margin: 0 0 15px 0 !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Purchase entry section taşma önleme */
    #purchase-entry-section {
        overflow-x: hidden !important;
    }

    #purchase-entry-section .card {
        overflow-x: hidden !important;
    }

    #purchase-entry-section h2 {
        font-size: 1rem !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    #purchase-entry-section p.subtitle {
        font-size: 0.8rem !important;
    }

    /* Tüm select genişliği zorunlu */
    #purchase-entry-section select,
    #purchase-entry-section input[type="text"],
    #purchase-entry-section input[type="number"],
    #purchase-entry-section input[type="date"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .assign-container {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        gap: 15px !important;
        width: 100% !important;
    }

    /* Tablo taşmalarını önlemek için responsive kart görünümleri */
    .table-responsive {
        border-radius: 12px;
        overflow-x: hidden;
    }

    /* Genel Table-to-Card Dönüşümü */
    .data-table:not(.no-card-mobile) {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    .data-table:not(.no-card-mobile) tbody {
        display: block !important;
        width: 100% !important;
    }

    .data-table:not(.no-card-mobile) thead {
        display: none;
    }

    .data-table:not(.no-card-mobile) tbody, 
    .data-table:not(.no-card-mobile) tr, 
    .data-table:not(.no-card-mobile) td {
        display: block;
        width: 100% !important;
    }

    /* Genel Table-to-Card Dönüşümü */
    .data-table:not(.no-card-mobile) tr {
        background: rgba(30, 41, 59, 0.4);
        backdrop-filter: blur(10px);
        margin-bottom: 20px;
        border-radius: 12px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        position: relative;
        overflow: hidden;
        display: block !important;
        width: 100% !important;
        clear: both;
    }

    .data-table:not(.no-card-mobile) td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        font-size: 0.95rem;
    }

    .data-table:not(.no-card-mobile) td:last-child {
        border-bottom: none;
    }

    .data-table:not(.no-card-mobile) td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        font-size: 0.8rem;
        flex: 1;
        text-align: left;
    }

    .asset-table-wrapper {
        border: none;
        background: transparent;
        overflow-x: hidden;
        margin-top: 15px !important;
    }

    /* Özel: Seçim (Zimmet) Tablosu Kartları */
    #assign-product-tbody tr {
        border-left: 5px solid #334155 !important;
        margin-bottom: 20px !important;
    }

    #assign-product-tbody tr:has(.assign-checkbox:checked) {
        border-left-color: var(--primary) !important;
        background: rgba(16, 185, 129, 0.05) !important;
    }

    #assign-product-tbody td[data-label="Seç"] {
        background: rgba(255, 255, 255, 0.05);
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #assign-product-tbody td[data-label="Seç"]::before {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--primary);
        text-transform: none; /* Keep it clean */
    }

    #assign-product-tbody td[data-label="Marka/Model"] {
        font-size: 1.05rem;
        font-weight: 600;
        padding: 10px 0;
    }

    #assign-product-tbody td[data-label="Marka/Model"] strong {
        color: var(--primary);
    }

    .assign-qty-input {
        background: rgba(15, 23, 42, 0.9) !important;
        border: 1.5px solid var(--primary) !important;
        color: #fff !important;
        text-align: center;
        border-radius: 10px !important;
        height: 40px;
        width: 80px !important;
        font-weight: 700;
        box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
    }

    #assign-product-tbody td::before {
        min-width: 120px;
        font-size: 0.8rem;
    }

    .inventory-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 15px;
        margin-bottom: 20px;
    }

    .inventory-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .inventory-filters .btn {
        flex: 1;
        min-width: calc(50% - 8px); /* 2 items per row minimum */
        padding: 8px 5px;
        font-size: 0.8rem;
    }

    .search-box {
        width: 100%;
        position: relative;
    }

    .search-box input {
        padding-right: 45px;
    }

    #mobile-menu-btn {
        font-size: 1.5rem;
        padding: 5px 10px;
        background: transparent;
        border: none;
        color: var(--primary);
    }

    /* Konum Raporları (Location/Personnel Reports) Tablosu */
    .loc-items-table {
        display: block;
    }
    .loc-items-table thead {
        display: none;
    }
    .loc-items-table tbody tr {
        display: block;
        background: rgba(255, 255, 255, 0.02);
        margin-bottom: 10px;
        border-radius: 8px;
        padding: 10px;
        border: 1px solid rgba(255,255,255,0.05);
    }
    .loc-items-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .loc-items-table tbody td:last-child {
        border-bottom: none;
    }
    .loc-items-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.72rem;
    }
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .stat-value {
        font-size: 1.2rem !important;
    }
}

/* Login Screen Styles */
.login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to right, #10b981, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo-icon {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: contain;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.08));
    border: 2px solid rgba(16, 185, 129, 0.2);
    padding: 10px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: loginLogoGlow 3s ease-in-out infinite;
}

@keyframes loginLogoGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 35px rgba(16, 185, 129, 0.3), 0 8px 32px rgba(0, 0, 0, 0.3); }
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.login-card input:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    outline: none;
}
/* Role Selector Styles */
.role-selector-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 8px;
    width: 100%;
}

.role-option input[type="radio"] {
    display: none;
}

.role-option label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-option label i {
    font-size: 1.5rem;
    color: var(--text-muted);
    opacity: 0.6;
    transition: all 0.3s;
}

.role-option .role-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-option strong {
    font-size: 0.95rem;
    color: var(--text-main);
    display: block;
}

.role-option span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.role-option input[type="radio"]:checked + label {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.role-option input[type="radio"]:checked + label i {
    color: var(--primary);
    opacity: 1;
    transform: scale(1.1);
}

.role-option input[type="radio"]:checked + label strong {
    color: var(--primary);
}

.role-option label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
    .role-selector-container {
        grid-template-columns: 1fr;
    }
}

.app-content {
    display: none;
}

/* User Avatar Styles */
.user-avatar-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-user {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Scanner Trigger Button in Search Boxes */
.scanner-trigger-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 5;
}

.scanner-trigger-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.scanner-trigger-btn:active {
    transform: translateY(-50%) scale(0.95);
}

@media (max-width: 768px) {
    .scanner-trigger-btn {
        font-size: 1.3rem;
        right: 8px;
    }
}

/* Ultra Premium Form Layout Enhancements */
.premium-form-section {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 15px 25px;
    padding: 30px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.premium-form-section::before {
    content: "";
    position: absolute;
    top: 30px;
    bottom: 30px;
    left: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 15px var(--primary);
}

.form-col-12 { grid-column: span 12; }
.form-col-7 { grid-column: span 7; }
.form-col-6 { grid-column: span 6; }
.form-col-5 { grid-column: span 5; }
.form-col-4 { grid-column: span 4; }
.form-col-3 { grid-column: span 3; }
.form-col-8 { grid-column: span 8; }

.input-icon-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s;
    opacity: 0.7;
}

.input-icon-wrapper input:focus + i,
.input-icon-wrapper select:focus + i {
    color: var(--primary);
    opacity: 1;
    transform: scale(1.1);
}

.input-icon-wrapper input,
.input-icon-wrapper select {
    width: 100%;
    height: 46px;
    background: rgba(15, 23, 42, 0.3);
}

.modern-toggle-box {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 0 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    height: 46px;
    margin-top: auto;
    transition: all 0.3s;
}

.modern-toggle-box:hover {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
}

.form-actions-premium {
    grid-column: span 12;
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 992px) {
    .premium-form-section {
        gap: 20px;
        padding: 20px;
    }
    
    .premium-form-section::before {
        top: 0;
        bottom: 0;
    }

    .form-col-3, .form-col-4, .form-col-5, .form-col-6, .form-col-7, .form-col-8 { 
        grid-column: span 12; 
    }
}

/* ===== PREMIUM INVOICE-STYLE PURCHASE ENTRY ===== */

.purchase-invoice-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.invoice-header-premium {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.invoice-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.invoice-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.invoice-title p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.icon-circle.primary { background: rgba(99, 102, 241, 0.1); color: #818cf8; }

.invoice-grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.invoice-items-section-premium {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.items-header-actions {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--card-border);
    gap: 15px;
}

@media (max-width: 768px) {
    .items-header-actions {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    .header-buttons {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    .header-buttons .btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0 15px;
    }
}

.items-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.items-title p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-glow {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.invoice-table-container {
    overflow-x: auto;
    max-height: 500px;
}

.modern-purchase-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-purchase-table th {
    background: rgba(0,0,0,0.2);
    padding: 15px 20px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modern-purchase-table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.modern-purchase-table tr:hover {
    background: rgba(255,255,255,0.015);
}

@media (max-width: 768px) {
    .modern-purchase-table thead {
        display: none;
    }
    .modern-purchase-table tr {
        display: block;
        background: rgba(255, 255, 255, 0.02);
        margin-bottom: 15px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        padding: 10px;
    }
    .modern-purchase-table td {
        display: flex;
        flex-direction: column;
        padding: 8px 10px;
        border-bottom: none;
    }
    .modern-purchase-table td::before {
        content: attr(data-label);
        font-size: 0.65rem;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 4px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
    .p-item-def, .p-item-type, .p-item-qty, .p-detail-cell, .p-item-price, .price-input-wrapper {
        width: 100% !important;
        min-width: 0 !important;
    }
    .p-item-qty {
        text-align: left !important;
    }
    .price-input-wrapper {
        justify-content: space-between;
        padding: 0 15px;
    }
}

.invoice-footer-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.1);
}

.invoice-summary-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-large {
    padding: 12px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
    font-weight: 600;
}

/* Row Specific Inputs */
.p-item-def, .p-item-type, .p-item-qty {
    height: 42px !important;
}

.p-item-def {
    width: 100%;
    min-width: 220px;
}

.p-item-qty {
    width: 70px !important;
    text-align: center;
}

.p-detail-cell {
    min-width: 280px;
}

.p-item-serials {
    width: 100%;
    min-height: 42px;
    max-height: 120px;
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.2) !important;
    padding-right: 42px !important;
    border-radius: 8px;
    resize: vertical;
    line-height: 1.4;
}

.price-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 0 12px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    width: fit-content;
}

.p-item-price {
    width: 95px !important;
    border: none !important;
    background: transparent !important;
    color: var(--primary) !important;
    font-weight: 700;
    font-size: 1rem;
    padding: 0 !important;
    margin: 0 !important;
}

.vat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--primary);
    cursor: pointer;
}

.btn-icon-danger {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-danger:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-buttons .btn {
    height: 38px;
    padding: 0 16px;
    white-space: nowrap;
}

.serial-status-hint {
    font-size: 0.65rem;
    margin-top: 6px;
    color: var(--text-muted);
    font-weight: 600;
}

.consumable-info-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

@media (max-width: 768px) {
    .invoice-footer-premium {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .invoice-grid-inputs {
        grid-template-columns: 1fr;
    }
    /* Tüm child form-group ve input/select tam genişlik */
    .invoice-grid-inputs .form-group,
    .invoice-grid-inputs label {
        width: 100% !important;
        display: flex;
        flex-direction: column;
    }
    .invoice-grid-inputs input,
    .invoice-grid-inputs select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }
}

.p-detail-container {
    width: 100%;
}

.p-textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 6px;
}

.p-textarea-wrapper {
    position: relative;
    width: 100%;
}

.p-item-serials {
    width: 100%;
    min-height: 42px;
    max-height: 120px;
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
    line-height: 1.4;
    color: var(--text-main);
}

.p-item-serials:focus {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.6) !important;
    outline: none;
}

.p-detail-container .scanner-trigger-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s;
}

.p-detail-container .scanner-trigger-btn:hover {
    background: #10b981;
    color: white;
}

@media (max-width: 768px) {
    .btn-icon-danger {
        width: 100%;
        margin-top: 10px;
        height: 45px;
    }
}

/* Floating Action Button (FAB) for Scanner */
.scanner-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: var(--warning);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.scanner-fab.visible {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.scanner-fab i {
    font-size: 1.5rem;
}

.scanner-fab span {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 2px;
}

.scanner-fab:hover {
    transform: scale(1.1) translateY(-5px);
    background: #d97706;
}

.scanner-fab::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--warning);
    animation: fab-pulse 2s infinite;
}

@keyframes fab-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Active Focus Highlight */
.p-item-serials.active-focus {
    border-color: var(--warning) !important;
    background: rgba(245, 158, 11, 0.05) !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15) !important;
}

.btn-orange {
    background: #f59e0b !important;
    color: white !important;
}

.btn-orange:hover {
    background: #d97706 !important;
}

/* Modal Detail Helper Classes */
.detail-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.detail-item strong {
    font-size: 0.95rem;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

/* Scanner Result Chip */
.last-scan-chip {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: monospace;
    border: 1px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-once {
    animation: bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce-in {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
/* Purchase Detail Modal Enhancements */
.detail-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    margin-top: 10px;
}

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

.premium-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 700;
}

.premium-table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    color: var(--text-main);
}

.premium-table tr:last-child td {
    border-bottom: none;
}

.premium-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* ===== PREMIUM FIRM INTERFACE ===== */
.premium-card {
    border-radius: 20px;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: var(--primary);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.7;
}

.input-with-icon input {
    padding-left: 45px !important;
    width: 100%;
}

.firm-type-selection {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.selection-title {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 800;
}

.toggle-group {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.btn-lg-premium {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.15);
}

.btn-lg-premium:active {
    transform: translateY(1px);
}

.table-container-premium {
    border-top: 2px solid rgba(16, 185, 129, 0.1);
    padding-top: 20px;
}

.table-header-info {
    margin-bottom: 20px;
}

.table-header-info h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.firm-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.firm-identity .f-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.firm-identity .f-account {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.firm-category-badges {
    display: flex;
    gap: 5px;
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.contact-info-cell .c-person {
    font-size: 0.85rem;
    font-weight: 600;
}

.contact-info-cell .c-phone {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .toggle-group {
        gap: 20px;
    }
    
    .btn-lg-premium {
        width: 100%;
    }
}

/* ============================================================
   LOKASYON BAZLI ZİMMET RAPORU - Hiyerarşik Accordion
   ============================================================ */
.loc-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loc-accordion-container .loc-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.loc-accordion-container .loc-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}

/* --- Lokasyon Kartı (Seviye 1) --- */
.loc-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.loc-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.loc-card.loc-open {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 32px rgba(99,102,241,0.1);
}

.loc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.loc-card-header:hover {
    background: rgba(255,255,255,0.03);
}
.loc-card-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.loc-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.08));
    color: #818cf8;
    flex-shrink: 0;
}
.loc-card.loc-open .loc-icon {
    background: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(99,102,241,0.15));
    color: #a5b4fc;
}
.loc-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}
.loc-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.loc-card-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.loc-badge {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.loc-print-btn {
    background: rgba(16,185,129,0.12);
    color: var(--primary);
    border: 1px solid rgba(16,185,129,0.25);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.loc-print-btn:hover {
    background: rgba(16,185,129,0.25);
    border-color: rgba(16,185,129,0.5);
}
.loc-chevron {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}
.loc-card.loc-open .loc-chevron {
    transform: rotate(180deg);
    color: #818cf8;
}

/* Lokasyon Body (Personel Kartları) */
.loc-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0,0,0,0.08);
}
.loc-card.loc-open .loc-card-body {
    max-height: 5000px;
}
.loc-card-body-inner {
    padding: 8px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- Personel Kartı (Seviye 2) --- */
.person-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}
.person-card:hover {
    border-color: rgba(16,185,129,0.3);
}
.person-card.person-open {
    border-color: rgba(16,185,129,0.4);
    box-shadow: 0 4px 16px rgba(16,185,129,0.08);
}

.person-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.person-card-header:hover {
    background: rgba(255,255,255,0.02);
}
.person-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.person-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.person-avatar.type-person {
    background: linear-gradient(135deg, #059669, #10b981);
}
.person-avatar.type-store {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}
.person-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.person-dept {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.person-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.person-item-count {
    background: rgba(16,185,129,0.12);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 700;
}
.person-print-btn {
    background: none;
    color: var(--primary);
    border: 1px solid rgba(16,185,129,0.25);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}
.person-print-btn:hover {
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.5);
}
.person-chevron {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}
.person-card.person-open .person-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Personel Body (Zimmet Tablosu) */
.person-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.person-card.person-open .person-card-body {
    max-height: 3000px;
}
.person-card-body-inner {
    padding: 0 12px 12px;
}

/* --- Zimmet Tablosu (İç Tablo) --- */
.loc-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.loc-items-table thead th {
    background: rgba(99,102,241,0.1);
    color: #a5b4fc;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid rgba(99,102,241,0.2);
}
.loc-items-table tbody td {
    padding: 8px 12px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.loc-items-table tbody tr:hover td {
    background: rgba(255,255,255,0.02);
}
.loc-items-table tbody tr:last-child td {
    border-bottom: none;
}
.loc-items-table .loc-serial-code {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99,102,241,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* --- Stats bar at the top --- */
.loc-stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.loc-stat-item {
    background: rgba(30,41,59,0.6);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}
.loc-stat-item i {
    font-size: 1.1rem;
    color: var(--primary);
}
.loc-stat-item .loc-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.loc-stat-item .loc-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .loc-card-header {
        padding: 12px 14px;
    }
    .loc-card-title {
        font-size: 0.9rem;
    }
    .loc-card-body-inner {
        padding: 6px 8px 10px;
    }
    .person-card-header {
        padding: 10px 12px;
    }
    .loc-stats-bar {
        gap: 8px;
    }
    .loc-stat-item {
        min-width: 120px;
        padding: 8px 12px;
    }
    .loc-print-btn span {
        display: none;
    }
    .person-print-btn span {
        display: none;
    }
}

/* ============================================
   PWA INSTALLATION BANNER
   ============================================ */
.pwa-install-banner {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.pwa-install-content i {
    font-size: 1.8rem;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pwa-install-text strong {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.pwa-install-text span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pwa-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.pwa-close-btn:hover {
    opacity: 1;
}

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

@media (max-width: 640px) {
    .pwa-install-banner {
        padding: 12px 14px;
    }
    .pwa-install-text span {
        display: none;
    }
}


/* Abonelik Geçmiş Modal Stil */
#sub-history-list {
    max-height: 400px;
    overflow-y: auto;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
}

#sub-history-list > div:last-child {
    border-bottom: none !important;
}

.max-w-800 {
    max-width: 800px !important;
}

/* Lisans Yönetimi Mobil İyileştirmeler */
@media (max-width: 768px) {
    .license-item-row {
        flex-direction: column !important;
        align-items: stretch !important;
        background: rgba(255, 255, 255, 0.03);
        padding: 15px;
        border-radius: 12px;
        border: 1px solid var(--card-border);
        gap: 15px !important;
    }

    .license-item-row .form-group {
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .license-item-row button {
        width: 100% !important;
        height: 45px !important;
        margin-top: 5px;
    }

    /* Fatura bilgileri yan yana durmasın mobilde */
    #add-license-form .flex.gap-20 {
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Lisans Raporu Özet tablosu için özel ayar */
    #license-summary-tbody td {
        padding: 10px 15px !important;
    }
}

/* ===================================================
   FATURA MODÜLİ MOBİL TAM DÜZELTME
   =================================================== */
@media (max-width: 768px) {

    /* Genel taşma önleme */
    .purchase-invoice-form,
    .invoice-header-premium,
    .invoice-items-section-premium,
    .invoice-footer-premium {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Input ve select elemanları ekrandan taşmasın */
    .invoice-header-premium input,
    .invoice-header-premium select,
    .invoice-grid-inputs input,
    .invoice-grid-inputs select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Fatura üst bilgi kartı */
    .invoice-header-premium {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    .invoice-title {
        margin-bottom: 18px !important;
        padding-bottom: 12px !important;
        gap: 10px !important;
    }

    .invoice-title h3 {
        font-size: 1rem !important;
    }

    .invoice-title p {
        font-size: 0.75rem !important;
    }

    .icon-circle {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
        flex-shrink: 0 !important;
    }

    /* Fatura grid input alanları — tek sütun */
    .invoice-grid-inputs {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .invoice-grid-inputs .form-group {
        width: 100% !important;
    }

    /* Ürünler listesi başlık alanı */
    .items-header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 14px !important;
        gap: 12px !important;
    }

    .items-title h3 {
        font-size: 0.95rem !important;
    }

    .header-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .header-buttons .btn {
        width: 100% !important;
        height: 44px !important;
        justify-content: center !important;
        font-size: 0.85rem !important;
    }

    /* Fatura tablosu — kart görünümü */
    .invoice-table-container {
        overflow-x: hidden !important;
        max-height: none !important;
    }

    .modern-purchase-table {
        display: block !important;
        width: 100% !important;
    }

    .modern-purchase-table thead {
        display: none !important;
    }

    .modern-purchase-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .modern-purchase-table tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: rgba(255, 255, 255, 0.025) !important;
        margin-bottom: 16px !important;
        border-radius: 14px !important;
        border: 1px solid rgba(255, 255, 255, 0.07) !important;
        padding: 14px !important;
    }

    .modern-purchase-table td {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 4px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
        vertical-align: top !important;
    }

    .modern-purchase-table td:last-child {
        border-bottom: none !important;
    }

    .modern-purchase-table td::before {
        content: attr(data-label);
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 700;
        color: var(--text-muted);
        margin-bottom: 6px;
    }

    /* Hücre içindeki tüm input/select tam genişlik */
    .modern-purchase-table td input,
    .modern-purchase-table td select,
    .modern-purchase-table td textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    /* Adet input'u merkez değil sol */
    .p-item-qty {
        width: 100% !important;
        text-align: left !important;
    }

    /* Fiyat wrapper tam genişlik */
    .price-input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: auto !important;
        padding: 10px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .p-item-price {
        width: 100% !important;
        flex: 1 !important;
    }

    /* Sil butonu tam genişlik */
    .btn-icon-danger {
        width: 100% !important;
        height: 44px !important;
        margin-top: 8px !important;
        border-radius: 10px !important;
        font-size: 0.85rem !important;
    }

    .btn-icon-danger::before {
        content: "Bu Satırı Sil  ";
        font-size: 0.8rem;
        font-weight: 600;
        margin-right: 6px;
    }

    /* Seri no textarea */
    .p-item-serials {
        min-height: 60px !important;
        font-size: 0.82rem !important;
    }

    /* Barkod tetikleyici buton */
    .p-detail-container .scanner-trigger-btn {
        width: 100% !important;
        justify-content: center !important;
        margin-top: 6px !important;
        padding: 10px !important;
        font-size: 0.82rem !important;
    }

    /* Footer — kaydet butonu */
    .invoice-footer-premium {
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px !important;
        text-align: center !important;
        border-radius: 12px !important;
    }

    .invoice-summary-placeholder {
        justify-content: center !important;
        font-size: 0.8rem !important;
    }

    .btn-large {
        width: 100% !important;
        font-size: 1rem !important;
        padding: 14px 20px !important;
        justify-content: center !important;
    }

    /* Satınalma formu genel boşluk */
    .purchase-invoice-form {
        gap: 16px !important;
    }
}
