:root {
    --sv-navy: #15152d;
    --sv-cream: #f8f3ea;
    --sv-card: #ffffff;
    --sv-gold: #e7b866;
    --sv-coral: #e1835e;
    --sv-brown: #7d533c;
    --sv-muted: #7d7480;
    --sv-border: #eadfd4;
    --sv-bg: #f6f1ea;
}

/* Page */
body {
    background: var(--sv-bg) !important;
    color: var(--sv-navy);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

a {
    color: #7d533c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== HEADER ========== */
header {
    background-color: #15152d;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    color: #f3f0e1;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-tagline {
    color: #aea8b4;
    font-size: 0.85rem;
}

/* ========== HERO FIX ========== */

.hero {
    position: relative;
    height: 320px;
    max-height: 360px;
    overflow: hidden;
    background: #15152d;
}

.hero img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    object-position: center 42%;
    display: block;

    /* restores volume */
    filter: brightness(0.78) contrast(1.08) saturate(1.12);
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
    padding: 2rem;

    background:
        radial-gradient(circle at center, rgba(0, 0, 0, 0.18), rgba(21, 21, 45, 0.62)),
        linear-gradient(to bottom, rgba(21, 21, 45, 0.12), rgba(21, 21, 45, 0.72));
}

.hero-overlay h2 {
    display: block;
    color: #fffaf5;
    font-family: Georgia, serif;
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.65rem;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.hero-overlay p {
    display: block;
    color: #f4e9df;
    font-size: 1.05rem;
    max-width: 680px;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

/* ========== SECTIONS ========== */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #7d533c;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #aea8b4;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.admin-shell {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 320px);
    background: #f8f5f0;
}

.admin-sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: #fffaf5;
    border-right: 1px solid #eadfd4;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    z-index: 20;
    display: flex;
    flex-direction: column;
}

.sidebar-inner {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #eadfd4;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--sv-brown);
    font-size: 0.85rem;
}

.sidebar-user i {
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--sv-muted);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 700;
    color: var(--sv-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sv-muted);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--sv-coral);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    text-align: left;
}

.sidebar-logout-btn:hover {
    background: #fdecea;
    color: #c0392b;
}

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.45rem;
    border-radius: 12px;
    color: #7d533c;
    font-weight: 800;
    text-decoration: none;
    transition: 0.18s ease;
}

.admin-nav-link:hover {
    background: #f0dfd1;
    color: #15152d;
    text-decoration: none;
}

.admin-nav-link.active {
    background: #15152d;
    color: #fffaf5;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    position: relative;
    min-width: 0;
    /* VERY important for flex overflow */
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-topbar h1 {
    font-family: Georgia, serif;
    font-weight: 900;
    color: #15152d;
    margin: 0;
}

.admin-breadcrumb {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #7d7480;
}

.admin-breadcrumb a {
    color: #7d533c;
    font-weight: 700;
}

.admin-breadcrumb span {
    margin-left: 0.35rem;
}

.view-pane {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.view-pane.active {
    opacity: 1;
    transform: translateY(0);
}

.view-loader {
    display: none;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: #7d533c;
    font-weight: 800;
}

.view-loader.active {
    display: flex;
}

.view-loader span {
    width: 18px;
    height: 18px;
    border: 3px solid #eadfd4;
    border-top-color: #e1835e;
    border-radius: 50%;
    animation: sv-spin 0.8s linear infinite;
}

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

.dashboard-heading h2,
.admin-page-header h2 {
    font-family: Georgia, serif;
    font-weight: 900;
    color: #15152d;
    margin-bottom: 0.25rem;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.admin-page-header p {
    color: #7d7480;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    border-radius: 18px;
    padding: 1.4rem;
    min-height: 125px;
    color: white;
    box-shadow: 0 14px 32px rgba(21, 21, 45, 0.12);
}

.stat-card h5 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 900;
    margin-bottom: 0.8rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
}

.stat-orders {
    background: linear-gradient(135deg, #15152d, #2d2b59);
}

.stat-revenue {
    background: linear-gradient(135deg, #16855b, #2aaa75);
}

.stat-clients {
    background: linear-gradient(135deg, #1598ad, #42c4d5);
}

.stat-items {
    background: linear-gradient(135deg, #e0a955, #f1c271);
    color: #24180f;
}

.dashboard-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.dashboard-panel {
    width: 100%;
    background: white;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 28px rgba(21, 21, 45, 0.08);
}

.dashboard-panel h5 {
    font-family: Georgia, serif;
    color: #7d533c;
    font-weight: 900;
    margin-bottom: 1rem;
}

.btn-admin-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e1835e;
    color: white;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
}

.btn-admin-primary:hover {
    background: #c96f4d;
    color: white;
    text-decoration: none;
}

.btn-admin-small {
    display: inline-flex;
    background: #15152d;
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

.btn-admin-small:hover {
    color: white;
    background: #2d2b59;
    text-decoration: none;
}

.admin-table th {
    color: #7d533c;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-table td {
    vertical-align: middle;
}

@media (max-width: 992px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        flex: none;
        height: auto;
        position: relative;
    }

    .admin-main {
        padding: 1.25rem;
    }

    .stats-grid,
    .dashboard-two-columns {
        grid-template-columns: 1fr;
    }

    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/*==========FOOTER==========*/
footer {
    background: #15152d;
    color: #aea8b4;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-inner p {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.footer-sub {
    font-size: 0.8rem;
    color: #7a7688;
}

.footer-links {
    margin-top: 0.75rem;
}

.footer-links a {
    color: #e1835e;
}

/* ========== HYBRID LAYOUT WIDTH FIX ========== */

.admin-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #f8f5f0;
}

.admin-sidebar {
    width: 260px;
    flex: 0 0 260px;
}

.admin-main {
    flex: 1;
    width: calc(100% - 260px);
    max-width: none;
    padding: 2rem;
    min-width: 0;
}

.dashboard-panel {
    width: 100%;
    max-width: none;
}

.admin-main .dashboard-panel {
    width: 100%;
}

.admin-main table {
    width: 100% !important;
}

.dataTables_wrapper,
.dt-container {
    width: 100% !important;
}

#categories-table {
    width: 100% !important;
}

.edit-only {
    display: none !important;
}

body.edit-mode .edit-only {
    display: block !important;
}

body.edit-mode input.edit-only,
body.edit-mode textarea.edit-only,
body.edit-mode select.edit-only {
    display: block !important;
}

body.edit-mode td.edit-only,
body.edit-mode th.edit-only {
    display: table-cell !important;
}

body.edit-mode .view-only {
    display: none !important;
}

.view-only {
    display: block;
}

.edit-only {
    display: none;
}

.edit-mode .view-only {
    display: none !important;
}

.edit-mode .edit-only {
    display: block !important;
}

.edit-mode .edit-only.d-none {
    display: block !important;
}

@media print {
    body * {
        visibility: hidden;
    }

    #invoice-container,
    #invoice-container * {
        visibility: visible;
    }

    #invoice-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .modal-header,
    .modal-footer,
    .btn-close {
        display: none !important;
    }

    .modal-dialog {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .modal-content {
        border: none !important;
        box-shadow: none !important;
    }

    .watermark-container {
        position: relative;
    }

    .draft-watermark {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


/* Print quality styling */
.invoice-content {
    font-family: Arial, Helvetica, sans-serif;
}

.invoice-items-table {
    width: 100%;
}

.invoice-items-table th,
.invoice-items-table td {
    border: 1px solid #ddd;
}