/* ═══════════════════════════════════════════════════════
   GBC Presales Platform — Shared Design System
   ═══════════════════════════════════════════════════════ */

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

:root {
    /* ── Brand Colors ── */
    --navy: #1a1a2e;
    --navy-light: #16213e;
    --navy-900: #0f0f1a;
    --accent: #d92624;
    --accent-light: #ff4744;
    --accent-glow: rgba(217, 38, 36, 0.15);
    --green: #16a34a;
    --green-light: #dcfce7;
    --blue: #3b82f6;
    --blue-light: #dbeafe;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    /* ── Neutrals ── */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* ── Spacing / Radius ── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);

    /* ── Cell Edit ── */
    --cell-edit: #fffbeb;
    --cell-edit-border: #f59e0b;
}

/* ── RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-100);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── TOP BAR ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: 56px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.topbar-logo img {
    height: 32px;
    width: auto;
}

.topbar-logo-text {
    font-weight: 800;
    font-size: 16pt;
    letter-spacing: -0.5px;
}

.topbar-logo-text span {
    color: var(--accent);
}

.topbar-title {
    flex: 1;
    font-size: 11pt;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    z-index: 300;
}

.hamburger-menu svg {
    width: 26px;
    height: 26px;
}

.topbar-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.topbar-nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 9pt;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.topbar-nav a:hover,
.topbar-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 9.5pt;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    flex-shrink: 0;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(217, 38, 36, 0.4);
}

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-green {
    background: var(--green);
    color: #fff;
}

.btn-green:hover {
    background: #15803d;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 8.5pt;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 11pt;
    border-radius: var(--radius-md);
}

/* ── CARDS ── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--navy), #2d1428);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 13pt;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

/* ── CONTAINER ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ── FORM ELEMENTS ── */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 9pt;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 10pt;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* ── TABLE ── */
.table-responsive {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
}

table.data-table thead th {
    background: var(--gray-800);
    color: #fff;
    padding: 11px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

table.data-table thead th:last-child {
    border-right: none;
}

table.data-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

table.data-table tbody tr:hover {
    background: var(--gray-50);
}

table.data-table td {
    padding: 10px 12px;
    border-right: 1px solid var(--gray-100);
    color: var(--gray-800);
}

table.data-table td:last-child {
    border-right: none;
}

/* ── STATUS BADGES ── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-draft {
    background: var(--blue-light);
    color: var(--blue);
}

.badge-review {
    background: var(--amber-light);
    color: #b45309;
}

.badge-accepted,
.badge-approved {
    background: var(--green-light);
    color: var(--green);
}

.badge-rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* ── NOTIFICATION TOAST ── */
.notif {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    background: var(--navy);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 10pt;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    pointer-events: none;
    max-width: 400px;
}

.notif.show {
    opacity: 1;
    transform: translateY(0);
}

.notif.success {
    border-left: 4px solid var(--green);
}

.notif.error {
    border-left: 4px solid var(--accent);
}

/* ── MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 560px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

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

.modal h3 {
    font-size: 14pt;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 18px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

/* ── SPINNER ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 0.8s ease-in-out infinite;
    margin: 20px auto;
}

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

/* ── PAGINATION ── */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 9pt;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── SEARCH BAR ── */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.search-bar input {
    flex: 1;
    padding: 8px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 10pt;
    font-family: inherit;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 14pt;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 10pt;
    max-width: 320px;
    margin: 0 auto;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 56px;
        padding: 12px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    .hamburger-menu {
        display: block;
        order: 1;
    }

    .topbar-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0;
        width: auto;
        justify-content: center;
    }

    .topbar-logo-text {
        font-size: 16pt;
    }

    /* Ascundem titlul pe mobil pentru un aspect mai curat */
    .topbar-title {
        display: none;
    }

    .topbar-nav {
        display: none;
        /* Ascuns default pe mobil */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--navy);
        flex-direction: column;
        padding: 0;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 299;
        order: 4;
        gap: 0;
    }

    .topbar-nav.active {
        display: flex;
        /* Arata flex cand are clasa active */
    }

    .topbar-nav a {
        white-space: normal;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 16px 24px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 11pt;
    }

    .topbar-nav a:last-child {
        border-bottom: none;
    }

    .topbar-actions {
        display: none;
    }

    .container {
        padding: 12px;
    }

    .modal {
        padding: 20px;
        margin: 12px;
    }

    .search-bar {
        flex-direction: column;
        gap: 8px;
    }

    .search-bar input {
        width: 100%;
    }
}

@media print {

    .topbar,
    .topbar-nav,
    .topbar-actions,
    .btn,
    .search-bar,
    .pagination,
    .modal-overlay,
    .notif {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}