/* ZUS Coffee Purchase Order System - Application CSS */

:root {
    --zus-primary: #173b78;
    --zus-primary-dark: #0f2a56;
    --zus-primary-light: #2c54a0;
    --zus-accent: #f5a400;
    --zus-accent-dark: #cc8800;
    --zus-sidebar-bg: #1a1f2e;
    --zus-sidebar-hover: #173b78;
    --zus-sidebar-active: #2c54a0;
    --zus-body-bg: #f5f7fb;
    --zus-text-dark: #1f2937;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--zus-body-bg);
    color: var(--zus-text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    color: var(--zus-primary);
}
a:hover {
    color: var(--zus-primary-dark);
}

/* Primary theme overrides */
.bg-primary {
    background-color: var(--zus-primary) !important;
}
.text-primary {
    color: var(--zus-primary) !important;
}
.btn-primary {
    background-color: var(--zus-primary);
    border-color: var(--zus-primary);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--zus-primary-dark) !important;
    border-color: var(--zus-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--zus-primary);
    border-color: var(--zus-primary);
}
.btn-outline-primary:hover {
    background-color: var(--zus-primary);
    border-color: var(--zus-primary);
}
.border-primary {
    border-color: var(--zus-primary) !important;
}

/* Warning / accent */
.bg-warning {
    background-color: var(--zus-accent) !important;
}
.btn-warning {
    background-color: var(--zus-accent);
    border-color: var(--zus-accent);
    color: #fff;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background-color: var(--zus-accent-dark) !important;
    border-color: var(--zus-accent-dark) !important;
    color: #fff;
}
.text-warning {
    color: var(--zus-accent) !important;
}

/* Sidebar */
.zus-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--zus-sidebar-bg);
    color: #fff;
    z-index: 1050;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.zus-sidebar.collapsed {
    transform: translateX(-100%);
}
.zus-sidebar .brand {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.zus-sidebar .brand .logo {
    width: 40px;
    height: 40px;
    background: var(--zus-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}
.zus-sidebar .brand .brand-text {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.1;
}
.zus-sidebar .brand .brand-text small {
    font-size: 11px;
    opacity: 0.75;
    display: block;
    font-weight: 400;
}
.zus-sidebar .nav-section {
    padding: 8px 0;
}
.zus-sidebar .nav-section-title {
    padding: 10px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
}
.zus-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.zus-sidebar .nav-link:hover {
    background: var(--zus-sidebar-hover);
    color: #fff;
}
.zus-sidebar .nav-link.active {
    background: var(--zus-sidebar-active);
    color: #fff;
    border-left-color: var(--zus-accent);
}
.zus-sidebar .nav-link i,
.zus-sidebar .nav-link .icon {
    width: 18px;
    text-align: center;
    opacity: 0.9;
}
.zus-sidebar .nav-link .chev {
    margin-left: auto;
    font-size: 10px;
    opacity: 0.6;
}
.zus-sidebar .submenu {
    background: rgba(0,0,0,0.15);
    padding: 2px 0 6px;
}
.zus-sidebar .submenu .nav-link {
    padding-left: 52px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.75);
}

/* Topbar */
.zus-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 0 22px;
    gap: 16px;
}
.zus-topbar .sidebar-toggle {
    background: none;
    border: none;
    color: var(--zus-text-dark);
    font-size: 22px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: none;
}
.zus-topbar .sidebar-toggle:hover {
    background: #f3f4f6;
}
.zus-topbar .page-title {
    font-weight: 600;
    font-size: 17px;
    color: var(--zus-text-dark);
}
.zus-topbar .spacer {
    flex: 1;
}
.zus-topbar .topbar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.zus-topbar .notification {
    position: relative;
}
.zus-topbar .notification .badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
}
.zus-topbar .user-area .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--zus-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Main wrapper */
.zus-wrapper {
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.zus-wrapper.sidebar-collapsed {
    margin-left: 0;
}
.zus-main {
    flex: 1;
    padding: 24px;
}
.zus-footer {
    padding: 14px 24px;
    font-size: 12px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

/* Cards */
.card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.card-header {
    background: #fafbfc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Tables */
.table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}
.table tbody td {
    font-size: 14px;
    vertical-align: middle;
}

/* Status badges */
.badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 12px;
    letter-spacing: 0.02em;
}
.badge-DRAFT, .badge-Draft {
    background: #e5e7eb !important;
    color: #374151 !important;
}
.badge-SUBMITTED, .badge-Submitted {
    background: #dbeafe !important;
    color: #1e40af !important;
}
.badge-FOR_APPROVAL, .badge-\.For\.Approval {
    background: #fef3c7 !important;
    color: #92400e !important;
}
.badge-APPROVED, .badge-Approved {
    background: #d1fae5 !important;
    color: #065f46 !important;
}
.badge-SENT_TO_SUPPLIER, .badge-\.Sent\.to\.Supplier {
    background: #e0e7ff !important;
    color: #3730a3 !important;
}
.badge-PARTIALLY_RECEIVED, .badge-\.Partially\.Received {
    background: #fde68a !important;
    color: #92400e !important;
}
.badge-FULLY_RECEIVED, .badge-\.Fully\.Received {
    background: #bbf7d0 !important;
    color: #065f46 !important;
}
.badge-CLOSED, .badge-Closed {
    background: #d1d5db !important;
    color: #1f2937 !important;
}
.badge-CANCELLED, .badge-Cancelled {
    background: #fee2e2 !important;
    color: #991b1b !important;
}
.badge-REJECTED, .badge-Rejected {
    background: #fecaca !important;
    color: #991b1b !important;
}
.badge-COMPLETED, .badge-Completed {
    background: #a7f3d0 !important;
    color: #065f46 !important;
}
.badge-MATCHED, .badge-Matched {
    background: #bfdbfe !important;
    color: #1e40af !important;
}
.badge-DISCREPANCY, .badge-Discrepancy {
    background: #fed7aa !important;
    color: #9a3412 !important;
}
.badge-PO_CREATED, .badge-\.PO\.Created {
    background: #c7d2fe !important;
    color: #3730a3 !important;
}

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #173b78 0%, #0f2a56 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    padding: 32px 28px;
}
.login-card .brand-block {
    text-align: center;
    margin-bottom: 22px;
}
.login-card .brand-block .logo-big {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: var(--zus-accent);
    border-radius: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 26px;
}
.login-card h4 {
    color: var(--zus-primary);
    font-weight: 700;
}

/* Mobile */
@media (max-width: 991.98px) {
    .zus-sidebar {
        transform: translateX(-100%);
    }
    .zus-sidebar.collapsed {
        transform: translateX(0);
    }
    .zus-wrapper {
        margin-left: 0;
    }
    .zus-topbar .sidebar-toggle {
        display: inline-flex;
    }
    .zus-main {
        padding: 16px;
    }
}

/* Print styles */
@media print {
    @page {
        size: A4;
        margin: 15mm;
    }
    .zus-sidebar,
    .zus-topbar,
    .zus-footer,
    .no-print {
        display: none !important;
    }
    .zus-wrapper {
        margin-left: 0 !important;
    }
    .zus-main {
        padding: 0 !important;
    }
    body {
        background: #fff !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
}
