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

:root {
    /* Brand Colors - Odoo Enterprise Inspired */
    --primary: #714B67;
    --primary-light: #8e6284;
    --primary-dark: #503148;
    --accent: #017E84;
    --accent-hover: #005f63;

    /* Functional Colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Neutrals */
    --bg-app: #f4f6f9;
    --bg-white: #ffffff;
    --text-dark: #212529;
    --text-medium: #4b5563;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #714B67;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Category Colors */
    --cat-overview: #2563eb;
    --cat-inventory: #059669;
    --cat-outbound: #d97706;
    --cat-sales: #ca8a04;
    --cat-vendors: #7c3aed;
    --cat-ledger: #0891b2;
    --cat-barcodes: #475569;
    --cat-system: #64748b;

    /* Text Colors */
    --text-light: #4b5563;
    --text-white: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e5e7eb;

    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 72px;
    --radius: 8px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-app);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Accessibility Focus */
:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.25);
    border-color: var(--primary);
}

/* --- Login Screen --- */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    background-image:
        radial-gradient(at 0% 0%, rgba(113, 75, 103, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(1, 126, 132, 0.05) 0px, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 3.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-logo {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2.5rem;
    display: block;
    letter-spacing: -0.05em;
}

/* --- App Layout --- */
#app-layout {
    display: flex;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#app-layout.active {
    opacity: 1;
    pointer-events: all;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #4b5563;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
    border-right: 1px solid var(--sidebar-border);
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: var(--primary);
    background: transparent;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.brand-name {
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1.1;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.brand-subtext {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1px;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.nav-category {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-category ion-icon {
    font-size: 1rem;
}

/* Category Specific Colors - Applying to both text and icon */
.cat-overview,
.cat-overview ion-icon {
    color: var(--cat-overview) !important;
}

.cat-inventory,
.cat-inventory ion-icon {
    color: var(--cat-inventory) !important;
}

.cat-outbound,
.cat-outbound ion-icon {
    color: var(--cat-outbound) !important;
}

.cat-sales,
.cat-sales ion-icon {
    color: var(--cat-sales) !important;
}

.cat-vendors,
.cat-vendors ion-icon {
    color: var(--cat-vendors) !important;
}

.cat-ledger,
.cat-ledger ion-icon {
    color: var(--cat-ledger) !important;
}

.cat-barcodes,
.cat-barcodes ion-icon {
    color: var(--cat-barcodes) !important;
}

.cat-system,
.cat-system ion-icon {
    color: var(--cat-system) !important;
}

.nav-link ion-icon[class*="cat-"] {
    opacity: 1;
}

/* Actually, simpler to put classes on nav-items or just target them better in HTML */

.nav-item {
    padding: 0.125rem 0.75rem;
}

.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    background: transparent;
    border: none;
    color: #4b5563;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary);
    background: #f3f4f6;
}

.nav-link.active {
    color: var(--primary);
    background: #f3e8ff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-link ion-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    opacity: 0.7;
}

.version-footer {
    margin-top: auto;
    padding: 1.25rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--sidebar-border);
    background: #fdfdfd;
}

.version-number {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 2px;
}

.user-panel {
    padding: 0;
    background: #f9fafb;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.menu-toggle:hover {
    background: var(--primary-dark);
}

/* Sidebar Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-app);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

.top-bar {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.content-area {
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
}

/* View Sections - Critical for Tab Switching */
.view-section {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1.25rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.user-status {
    font-size: 11px;
    font-weight: 500;
    color: #10b981;
    /* Odoo Success Green */
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

.user-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    background: #f8fafc;
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

#btnSyncData:hover {
    color: #4ade80;
}

#btnSyncData:active ion-icon {
    animation: spin 0.5s ease-in-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#btnLogout:hover {
    color: #f87171;
}

/* --- Views --- */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Components --- */

/* Grid System for Forms */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-1 {
    flex: 0 0 8.333333%;
    max-width: 8.333333%;
    padding: 0 0.75rem;
}

.col-md-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
    padding: 0 0.75rem;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.75rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.75rem;
}

.col-md-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    padding: 0 0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
}

.col-md-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
    padding: 0 0.75rem;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 0.75rem;
}

.col-md-9 {
    flex: 0 0 75%;
    max-width: 75%;
    padding: 0 0.75rem;
}

.col-md-10 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
    padding: 0 0.75rem;
}

.col-md-11 {
    flex: 0 0 91.666667%;
    max-width: 91.666667%;
    padding: 0 0.75rem;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

/* --- USER PANEL (Sidebar Footer) --- */
.user-panel {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    /* Enable flex truncation */
}

.user-details {
    flex: 1;
    min-width: 0;
    /* Enable text truncation */
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-status {
    font-size: 0.7rem;
    color: #22c55e;
    font-weight: 500;
}

.user-status::before {
    content: '●';
    margin-right: 4px;
}

.user-buttons {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* --- GLOBAL RESPONSIVE: Ensure rows always wrap --- */
.row {
    flex-wrap: wrap;
}

/* --- TABLET RESPONSIVE STYLES (900px - 1024px) --- */
@media (max-width: 1024px) {

    /* Wrap columns to 50% on tablet */
    .col-md-2,
    .col-md-3,
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-5,
    .col-md-6,
    .col-md-7 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Make BOM action buttons stack properly */
    #bom-planner .row .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 0.5rem;
    }

    /* Data Management grid */
    .data-mgmt-grid {
        grid-template-columns: 1fr !important;
    }

    /* Flex containers should wrap */
    .d-flex {
        flex-wrap: wrap;
    }

    /* Page header actions wrap */
    .page-header .actions {
        flex-wrap: wrap;
    }

    /* Logs filter section wraps */
    #logs .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* --- SMALL TABLET (max-width: 900px) --- */
@media (max-width: 900px) {

    /* All columns go full width */
    .col-md-1,
    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-5,
    .col-md-6,
    .col-md-7,
    .col-md-8,
    .col-md-9,
    .col-md-10,
    .col-md-11,
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Form groups need bottom margin when stacked */
    .form-group {
        margin-bottom: 0.75rem;
    }
}

/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 768px) {

    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 100;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Show hamburger menu on mobile */
    .menu-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Show overlay when sidebar is open */
    .sidebar-overlay.active {
        display: block;
    }

    /* Adjust top bar to make room for hamburger */
    .top-bar {
        padding-left: 4rem;
    }

    /* Full width columns on mobile */
    .col-md-1,
    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-5,
    .col-md-6,
    .col-md-7,
    .col-md-8,
    .col-md-9,
    .col-md-10,
    .col-md-11,
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Page Header Stack */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header .actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header .actions input {
        width: 100% !important;
        flex: 1;
    }

    .page-header .actions button {
        flex: 1;
    }

    /* Modal Mobile */
    .modal-content,
    .modal-popup {
        width: 95% !important;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.9rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    height: 38px;
    /* Consistent height */
    color: var(--text-dark);
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    /* More emphasized */
    font-size: 0.85rem;
    color: var(--text-medium);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(113, 75, 103, 0.2);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.025em;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header .actions {
    display: flex;
    gap: 0.75rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-medium);
}

.btn-success {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 4px rgba(1, 126, 132, 0.2);
}

.btn-success:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 8px rgba(1, 126, 132, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border-color: var(--border-color);
    color: var(--text-medium);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #c0c4c8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* Data Management Specifics */
.data-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.data-mgmt-card,
.credential-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.data-mgmt-card h4,
.credential-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-mgmt-card p,
.credential-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
    min-height: 2.6rem;
    display: flex;
    align-items: flex-start;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    padding: 0.35rem 0.4rem;
}

.checkbox-label span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-mgmt-actions {
    margin-top: auto;
    padding-top: 1rem;
}

.data-mgmt-actions>div {
    flex-wrap: wrap;
}

.data-mgmt-actions button {
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .data-mgmt-actions>div {
        flex-direction: column;
        gap: 0.5rem !important;
        /* Override inline style */
    }

    .data-mgmt-actions button {
        width: 100%;
        margin-bottom: 5px;
    }
}

th {
    background: #ffffff;
    /* Cleaner look */
    font-weight: 700;
    color: var(--text-medium);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

tr:hover td {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    /* Rectangle style */
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Utilities */
.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.d-flex {
    display: flex;
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.align-end {
    align-items: flex-end;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Custom Modal Overlay */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.custom-modal .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 90%;
    max-width: 500px;
}

.custom-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.custom-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.custom-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* --- Issued Items & Location Explorer Styles --- */
.badge-issued {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-returned {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-overdue {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.location-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-card:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.btn-datasheet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-datasheet:hover {
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
}