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

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --sidebar-text-hover: #ffffff;
    --sidebar-active: #1f2937;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* LOGIN SCREEN */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #111827 100%);
}

.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: white;
}

.login-container h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

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

.login-container .form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.login-container .form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

.login-container .form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.login-container .btn-primary {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.login-container .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

/* ADMIN LAYOUT */
.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    flex: 0 0 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-close, .sidebar-toggle, .sidebar-backdrop, .mobile-sidebar-fab { display: none; }
.admin-header-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.menu-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-hover);
    border-left: 4px solid var(--primary);
}

.menu-item i {
    margin-right: 12px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-header {
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.admin-profile-trigger { width:40px; height:40px; border:0; border-radius:50%; background:var(--primary); color:#fff; }
.user-profile > div[style] { display:none !important; }
.admin-profile-dropdown { display:none; position:absolute; right:24px; top:62px; z-index:1050; width:210px; padding:8px; background:#fff; border:1px solid #e2e8f0; border-radius:12px; box-shadow:0 14px 35px rgba(15,23,42,.16); }
.admin-profile-dropdown.show { display:block; }
.admin-profile-dropdown-title { padding:9px 10px; color:#64748b; font-size:13px; font-weight:700; border-bottom:1px solid #f1f5f9; margin-bottom:5px; }
.admin-profile-dropdown button, .admin-profile-dropdown a { width:100%; border:0; background:transparent; display:flex; gap:10px; align-items:center; padding:10px; border-radius:8px; color:#334155; text-decoration:none; text-align:left; }
.admin-profile-dropdown button:hover, .admin-profile-dropdown a:hover { background:#f1f5f9; color:var(--primary); }

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.content-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 720px; }
.content-body img { max-width: 100%; }

@media (max-width: 1024px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;
        width: min(82vw, 290px);
        transform: translateX(-105%);
        box-shadow: 18px 0 45px rgba(15, 23, 42, .28);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-header { position: relative; padding-right: 54px; }
    .sidebar-close {
        display: inline-flex; position: absolute; right: 14px; top: 17px; width: 36px; height: 36px;
        align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.15);
        border-radius: 9px; background: rgba(255,255,255,.08); color: #fff;
    }
    .sidebar-toggle {
        display: inline-flex !important; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center;
        border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #334155;
    }
    .mobile-sidebar-fab {
        display: inline-flex !important;
        position: fixed;
        left: 12px;
        top: 11px;
        z-index: 1150;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid #dbe3ee;
        border-radius: 11px;
        background: #fff;
        color: #0f172a;
        box-shadow: 0 5px 16px rgba(15, 23, 42, .16);
    }
    .admin-header-title .sidebar-toggle { visibility: hidden; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1190; border: 0; background: rgba(15,23,42,.48); }
    .sidebar-backdrop.show { display: block; }
    .top-header { padding: 0 20px; }
    .content-body { padding: 22px; }
}

@media (max-width: 767.98px) {
    .top-header { height: 62px; padding: 0 12px; }
    .top-header h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
    .user-profile { gap: 6px; }
    .user-profile > span { display: none; }
    .admin-profile-trigger { width: 38px; height: 38px; }
    .admin-profile-dropdown { right: 10px; top: 56px; max-width: calc(100vw - 20px); }
    .content-body { padding: 14px 10px 24px; }
    .card { padding: 14px; border-radius: 10px; }
    .content-header { align-items: flex-start !important; gap: 10px; flex-wrap: wrap; }
    .content-body h2 { font-size: 21px; }
    .content-body > div[style*="justify-content:space-between"] { flex-wrap: wrap; gap: 10px; }
    .content-body > div[style*="justify-content:space-between"] > div { flex-wrap: wrap; max-width: 100%; }
    .modal-overlay { padding: 8px !important; align-items: flex-start !important; overflow-y: auto; }
    .modal-overlay .modal-content { width: 100% !important; max-width: 100% !important; max-height: calc(100dvh - 16px) !important; margin: 0 !important; border-radius: 12px !important; }
    .modal-tabs { overflow-x: auto; flex-wrap: nowrap !important; }
    .modal-tab { white-space: nowrap; padding: 11px 14px !important; }
    .modal-body, .modal-body-scroll { padding: 14px !important; max-height: calc(100dvh - 150px) !important; }
    input, select, textarea, button { max-width: 100%; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { float: none !important; text-align: left !important; margin: 8px 0; }
    .dataTables_wrapper .dataTables_filter input { width: min(100%, 220px) !important; }
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { float: none !important; text-align: center !important; margin-top: 10px; }
    .form-row, .form-grid { grid-template-columns: 1fr !important; }
    .modal-content > div[style*="flex-direction:row"] { flex-direction: column !important; overflow-y: auto !important; }
    .modal-content > div[style*="flex-direction:row"] > div { width: 100% !important; flex: none !important; border-left: 0 !important; border-right: 0 !important; }
}

@media (max-width: 420px) {
    .sidebar { width: 88vw; }
    .content-body { padding-inline: 8px; }
    .card { padding: 11px; }
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 24px;
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 24px;
}

.dashboard-grid > .card {
    margin-bottom: 0 !important;
    min-width: 0;
}

.orders-page { display: flex; flex-direction: column; gap: 16px; }
.orders-hero h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.orders-hero p { margin: 6px 0 0; color: #64748b; font-size: 13px; }
.orders-hero strong { color: #0f172a; }

.orders-filter { margin: 0; }
.orders-filter-panel {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
    overflow: hidden;
}
.orders-filter-panel > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
}
.orders-filter-panel > summary::-webkit-details-marker { display: none; }
.orders-filter-summary-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    flex-shrink: 0;
}
.orders-filter-summary-main i { color: #3b82f6; }
.orders-filter-count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.orders-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.orders-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.orders-chip em { color: #94a3b8; font-style: normal; font-weight: 700; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.orders-filter-toggle {
    margin-left: auto;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.orders-filter-toggle i { transition: transform .2s ease; }
.orders-filter-panel[open] .orders-filter-toggle i { transform: rotate(180deg); }
.orders-filter-body {
    padding: 4px 18px 18px;
    border-top: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fbfdff 0%, #fff 48px);
}
.orders-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding-top: 16px;
}
.orders-filter-grid label { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.orders-filter-grid label span { font-size: 12px; font-weight: 700; color: #475569; }
.orders-filter-grid input,
.orders-filter-grid select {
    width: 100%;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    color: #0f172a;
    outline: none;
}
.orders-filter-grid input:focus,
.orders-filter-grid select:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.orders-filter-span { grid-column: span 2; }
.orders-filter-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.orders-filter-actions .btn { width: auto; padding: 10px 16px; transform: none; }

.orders-table-card {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
    overflow: hidden;
}
.orders-table { margin: 0; width: 100%; min-width: 1120px; table-layout: fixed; }
.orders-table thead { background: #fbfaf8; }
.orders-table th { padding: 13px 14px; font-size: 11px; font-weight: 700; color: #8a8178; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid #eeeae6; white-space: nowrap; }
.orders-table td { padding: 14px; vertical-align: middle; border-bottom: 1px solid #f3efe9; overflow: hidden; }
.orders-table tbody tr.orders-main:hover { background: #fcfbf9; }
.orders-col-photo { width: 92px; }
.orders-table th:nth-child(2), .orders-table .orders-main td:nth-child(2) { width: 200px; }
.orders-table th:nth-child(3), .orders-table .orders-main td:nth-child(3) { width: 120px; }
.orders-table th:nth-child(6), .orders-table .orders-main td:nth-child(6) { width: 150px; }
.orders-table th:nth-child(7), .orders-table .orders-main td:nth-child(7) { width: 120px; }
.orders-table th:nth-child(8), .orders-table .orders-main td:nth-child(8) { width: 268px; }
.orders-tip-cell { overflow: visible !important; }
.orders-clip {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}
.orders-clip:hover .orders-strong { text-decoration: underline; text-underline-offset: 3px; }
.orders-clip .orders-strong,
.orders-clip .orders-muted { display: block; }
.orders-tip {
    position: fixed;
    z-index: 40;
    min-width: 220px;
    max-width: 320px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #eeeae6;
    border-radius: 12px;
    box-shadow: 8px 12px 32px rgba(23, 23, 21, .16);
}
.orders-tip::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 16px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #eeeae6;
    border-bottom: 1px solid #eeeae6;
    transform: rotate(45deg);
}
.orders-tip strong,
.orders-tip span { display: block; color: #171715; font-size: 14px; line-height: 1.45; word-break: break-word; }
.orders-tip strong { margin-bottom: 4px; }
.orders-tip span { color: #5c564e; font-size: 13px; }
.orders-lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.orders-lead-text { min-width: 0; }
.orders-code { font-weight: 700; color: #171715; letter-spacing: .01em; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orders-date { font-weight: 700; color: #171715; }
.orders-time, .orders-muted { color: #8a8178; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orders-strong { font-weight: 600; color: #171715; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orders-qty { font-weight: 600; color: #171715; white-space: nowrap; font-size: 13px; }
.orders-empty { text-align: center; padding: 36px 16px !important; color: #8a8178; }
.orders-detail-btn { width: auto !important; padding: 6px 12px; transform: none !important; }
.orders-row-actions { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 250px; }
.orders-row-actions .btn,
.orders-row-actions .btn-primary,
.orders-row-actions .btn-success,
.orders-row-actions .btn-outline-danger,
.orders-row-actions .btn-outline-dark {
    width: auto !important;
    min-width: 0;
    flex: 0 0 auto;
    transform: none !important;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
}
.orders-row-actions form { margin: 0; display: inline-flex; flex: 0 0 auto; }
.orders-row-actions form .btn { width: auto !important; }
.orders-thumb {
    width: 72px; height: 72px; object-fit: contain; border-radius: 12px;
    border: 1px solid #eeeae6; background: #faf8f5; display: block;
}
.orders-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: #c2b5a5; font-size: 22px; }
.orders-mail {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}
.orders-mail-sent { background: #ecfdf5; color: #047857; }
.orders-mail-failed { background: #fef2f2; color: #b91c1c; }
.orders-mail-pending { background: #fff7ed; color: #c2410c; }
.orders-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.orders-status-pending { background: #fff7ed; color: #c2410c; }
.orders-status-accepted { background: #ecfdf5; color: #047857; }
.orders-status-cancelled { background: #fef2f2; color: #b91c1c; }
.orders-pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.orders-pager .btn { width: auto; padding: 8px 14px; transform: none; }
.orders-pager span { color: #64748b; font-size: 13px; }

@media (max-width: 1100px) {
    .orders-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .orders-filter-span { grid-column: span 2; }
}

@media (max-width: 767.98px) {
    .orders-hero h2 { font-size: 22px; }
    .orders-filter-panel > summary { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
    .orders-filter-chips { width: 100%; order: 3; }
    .orders-filter-toggle { margin-left: 0; }
    .orders-filter-grid { grid-template-columns: 1fr; }
    .orders-filter-span { grid-column: auto; }
    .orders-filter-body { padding: 0 12px 14px; }
    .orders-filter-actions { justify-content: stretch; }
    .orders-filter-actions .btn { flex: 1; }
    .orders-table thead { display: none; }
    .orders-table, .orders-table tbody, .orders-table tr, .orders-table td { display: block; width: 100%; }
    .orders-table tr {
        padding: 12px 12px 8px;
        border-bottom: 8px solid #f3f4f6;
    }
    .orders-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border: 0;
        text-align: right;
    }
    .orders-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #94a3b8;
        text-align: left;
    }
    .orders-table td[data-label=""] { justify-content: flex-end; padding-top: 10px; }
    .orders-table td[data-label=""]::before { content: none; }
    .orders-col-photo { width: auto; }
    .orders-col-photo.orders-table td,
    .orders-table td.orders-col-photo { display: flex; justify-content: flex-start; }
    .orders-row-actions { width: 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
    .orders-strong, .orders-muted { white-space: normal; overflow: visible; text-overflow: unset; }
    .orders-clip { pointer-events: none; }
    .orders-tip { display: none !important; }
    .table-responsive table { min-width: 0 !important; table-layout: auto; }
}

@media (max-width: 420px) {
    .orders-chip { max-width: 100%; }
}


