/* ========================================================================
   CODARO CRM — Frontend Stylesheet
   Design: light mode, clean, modern, refinat
   Paletă: verde natural CODARO + tonuri neutre calde
   ======================================================================== */

:root {
    /* Brand */
    --green-50:  #f1f7ec;
    --green-100: #dceacf;
    --green-200: #bcd6a3;
    --green-300: #97bf75;
    --green-400: #79a956;
    --green-500: #5b9b3e;   /* primar — verde logo */
    --green-600: #4a8030;
    --green-700: #3a6526;
    --green-800: #2a4a1c;
    --green-900: #1f4d2b;   /* verde închis logo */

    /* Neutre calde */
    --bg:        #faf8f3;   /* background principal — crem cald */
    --bg-soft:   #f5f1e8;
    --surface:   #ffffff;
    --border:    #e8e2d5;
    --border-strong: #d4cdb8;

    /* Text */
    --text:      #1a1a1a;
    --text-soft: #5a5a55;
    --text-mute: #8a8a82;

    /* Accent */
    --accent:    #c87a3a;   /* portocaliu cărămidă pentru contrast */
    --danger:    #c0392b;
    --success:   var(--green-500);
    --warning:   #d69e2e;

    /* Tipografie */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spațiere */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Umbre rafinate */
    --shadow-sm: 0 1px 2px rgba(31, 77, 43, 0.04), 0 1px 3px rgba(31, 77, 43, 0.06);
    --shadow:    0 4px 6px -1px rgba(31, 77, 43, 0.06), 0 2px 4px -2px rgba(31, 77, 43, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(31, 77, 43, 0.10), 0 8px 10px -6px rgba(31, 77, 43, 0.06);

    /* Tranziții */
    --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t:      200ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================ RESET ============================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(at 12% 5%, rgba(91, 155, 62, 0.04) 0, transparent 45%),
        radial-gradient(at 95% 90%, rgba(31, 77, 43, 0.03) 0, transparent 50%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--green-700); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--green-500); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); font-weight: 600; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

/* ============================ AUTH ============================ */
.auth-body {
    background: var(--bg);
    background-image:
        radial-gradient(at 20% 25%, rgba(91, 155, 62, 0.10) 0, transparent 50%),
        radial-gradient(at 85% 75%, rgba(31, 77, 43, 0.08) 0, transparent 55%);
}
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green-500), var(--green-900));
}
.auth-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    margin: 0 auto 1.25rem;
}
.auth-title {
    text-align: center;
    margin-bottom: 0.25rem;
    font-size: 1.6rem;
}
.auth-sub {
    text-align: center;
    color: var(--text-mute);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
.auth-help {
    color: var(--text-soft);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-soft);
    letter-spacing: 0.02em;
}
.auth-form input {
    padding: 0.75rem 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.auth-form input:focus {
    outline: none;
    border-color: var(--green-500);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(91, 155, 62, 0.12);
}
.auth-remember {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 400 !important;
    color: var(--text-soft) !important;
    font-size: 0.875rem !important;
    cursor: pointer;
    user-select: none;
}
.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--green-500);
    cursor: pointer;
}
.auth-footer {
    margin-top: 2rem;
    color: var(--text-mute);
    font-size: 0.78rem;
    text-align: center;
    max-width: 440px;
    line-height: 1.6;
}

/* ============================ ALERTS ============================ */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-success { background: var(--green-50); border-color: var(--green-200); color: var(--green-800); }
.alert-error   { background: #fdecea; border-color: #f5c6cb; color: #842029; }
.alert-warning { background: #fff3cd; border-color: #ffe69c; color: #664d03; }
.alert-info    { background: #e7f1fb; border-color: #cce0f5; color: #084298; }

/* ============================ BUTTONS ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.btn-primary {
    background: var(--green-500);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, var(--shadow-sm);
}
.btn-primary:hover { background: var(--green-600); transform: translateY(-1px); box-shadow: var(--shadow); color: #fff; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--green-300); color: var(--text); }

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: #f5c6cb;
}
.btn-danger:hover { background: #fdecea; }

.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.9rem 1.5rem; font-size: 0.95rem; }
.btn-block { display: flex; width: 100%; }

/* ============================ LAYOUT ============================ */
.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.sidebar-brand img {
    height: 36px;
    width: auto;
}
.sidebar-brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--green-900);
    letter-spacing: -0.025em;
    line-height: 1;
}
.sidebar-brand-sub {
    font-size: 0.72rem;
    color: var(--green-500);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.85rem 0.4rem;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--t-fast);
    position: relative;
}
.nav-item:hover {
    background: var(--bg-soft);
    color: var(--text);
}
.nav-item.active {
    background: var(--green-50);
    color: var(--green-800);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: var(--green-500);
    border-radius: 0 3px 3px 0;
}
.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.75;
    fill: none;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 0.3rem;
}
.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.user-info {
    flex: 1;
    min-width: 0;
}
.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-meta {
    font-size: 0.72rem;
    color: var(--text-mute);
}

/* ============================ MAIN ============================ */
.main {
    padding: 2rem 2.5rem 4rem;
    max-width: 1300px;
    width: 100%;
}
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.page-title { margin: 0; }
.page-sub {
    color: var(--text-mute);
    font-size: 0.875rem;
    margin: 0.4rem 0 0;
}
.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ============================ CARDS ============================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-body);
    letter-spacing: -0.01em;
}

/* ============================ STATS GRID ============================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.4rem 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--t), box-shadow var(--t);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.03em;
}
.stat-meta {
    font-size: 0.78rem;
    color: var(--text-mute);
    margin-top: 0.5rem;
}
.stat-icon {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 36px;
    height: 36px;
    background: var(--green-50);
    color: var(--green-700);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* ============================ TABLE ============================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}
.table th {
    background: var(--bg-soft);
    font-weight: 600;
    color: var(--text-soft);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--green-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table .row-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-mute);
}
.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--bg-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-600);
}
.empty-state-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.75; fill: none; }

/* ============================ FORMS ============================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-soft);
    letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: all var(--t);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(91, 155, 62, 0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ============================ BADGES ============================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.badge-default { background: var(--bg-soft); color: var(--text-soft); border-color: var(--border); }
.badge-primary { background: var(--green-50); color: var(--green-800); border-color: var(--green-200); }
.badge-success { background: var(--green-50); color: var(--green-800); border-color: var(--green-300); }
.badge-warning { background: #fff7e0; color: #5c4a00; border-color: #f0d97c; }
.badge-danger  { background: #fdecea; color: #842029; border-color: #f5c6cb; }
.badge-info    { background: #e7f1fb; color: #084298; border-color: #cce0f5; }

/* ============================ SEARCH BAR ============================ */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 440px;
}
.search-bar input {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.4rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all var(--t);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(91, 155, 62, 0.12);
}
.search-bar svg {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--text-mute);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

/* ============================ MODAL ============================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 20, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 100;
    animation: fadeIn var(--t) ease-out;
}
.modal-overlay.is-open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp var(--t-slow) cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-body);
    letter-spacing: -0.01em;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-mute);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text); background: var(--bg-soft); }
.modal-body { padding: 1.5rem; }
.modal-large { max-width: 760px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================ TIMELINE ============================ */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.62rem;
    top: 0.4rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    border: 2.5px solid var(--green-500);
    box-shadow: 0 0 0 4px var(--bg);
}
.timeline-item-clickable {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 1.75rem;
    border-radius: var(--radius);
    transition: background var(--t-fast);
}
.timeline-item-clickable:hover {
    background: var(--green-50);
}
.timeline-item-clickable:last-child {
    padding-bottom: 0.25rem;
}
.timeline-meta {
    font-size: 0.75rem;
    color: var(--text-mute);
    margin-bottom: 0.25rem;
}
.timeline-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.timeline-body {
    color: var(--text-soft);
    font-size: 0.875rem;
}

/* ============================ ABOUT PAGE ============================ */
.about-hero {
    background: linear-gradient(135deg, var(--green-50) 0%, var(--bg) 100%);
    border: 1px solid var(--green-100);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.about-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(91, 155, 62, 0.08), transparent 60%);
    pointer-events: none;
}
.about-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--green-700);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding: 0.3rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--green-200);
    border-radius: 999px;
}
.about-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
    margin-bottom: 0.75rem;
    max-width: 720px;
}
.about-lead {
    font-size: 1.05rem;
    color: var(--text-soft);
    max-width: 640px;
    line-height: 1.65;
    margin: 0;
}
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.info-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.info-block dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}
.info-block dd {
    margin: 0 0 1rem;
    font-size: 0.95rem;
}
.info-block dd:last-child { margin-bottom: 0; }
.eu-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
.eu-bar-item {
    text-align: center;
    color: var(--text-mute);
    font-size: 0.78rem;
    font-weight: 500;
}

/* ============================ MOBILE ============================ */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
    background: var(--green-500);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    z-index: 90;
}
.mobile-nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Prevenim overflow orizontal global */
html, body { overflow-x: hidden; max-width: 100vw; }
.app { max-width: 100vw; overflow-x: hidden; }
.main { min-width: 0; }

/* Forțăm ascunderea admin bar-ului WP pe paginile CRM, chiar și dacă userul l-a forțat din profil */
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; padding-top: 0 !important; }
* html body { margin-top: 0 !important; }
@media screen and (max-width: 782px) {
    html { margin-top: 0 !important; }
}

/* Toate elementele cu word-break să se rupă natural */
.card, .table-wrap, .timeline, .stat, .modal {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform var(--t-slow);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .main { padding: 1.25rem 1rem 5rem; min-width: 0; }
    .mobile-nav-toggle { display: flex; align-items: center; justify-content: center; }
    .page-header {
        flex-direction: column;
        align-items: stretch;
        padding-top: 2.5rem; /* loc pentru toggle */
    }
    .page-header .page-actions { width: 100%; flex-wrap: wrap; }
    .page-header .page-actions .btn { flex: 1; min-width: 0; justify-content: center; }
    .stats { grid-template-columns: 1fr; gap: 0.75rem; }
    .stat { padding: 1rem 1.1rem; }
    .stat-value { font-size: 1.75rem; }
    .stat-icon { width: 30px; height: 30px; top: 0.9rem; right: 0.9rem; }
    .stat-icon svg { width: 15px; height: 15px; }

    /* Tabele — scroll orizontal în loc de overflow */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 540px; } /* scroll orizontal pe ecrane mici */
    .table th, .table td { padding: 0.6rem 0.7rem; font-size: 0.825rem; }

    /* Cards & panele */
    .card { padding: 1rem; }
    .card-header { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; padding-bottom: 0.75rem; }
    .card-header .btn { font-size: 0.75rem; padding: 0.4rem 0.7rem; }
    .card-title { font-size: 0.95rem; }

    /* Modal — full screen pe mobil */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin: 0;
    }
    .modal-large { max-width: 100%; }
    .modal-header { padding: 1rem 1.25rem; position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-body { padding: 1.25rem; }
    .form-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }

    /* Quote items pe mobil — afișaj vertical */
    .quote-item-row {
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas:
            "desc desc"
            "qty price"
            "total remove" !important;
        gap: 0.5rem !important;
    }
    .quote-item-row > input[type="text"] { grid-area: desc; }
    .quote-item-row > .qty { grid-area: qty; }
    .quote-item-row > .price { grid-area: price; }
    .quote-item-row > .line-total { grid-area: total; align-self: center; }
    .quote-item-row > .remove-row { grid-area: remove; justify-self: end; }

    /* Timeline */
    .timeline { padding-left: 1.5rem; }
    .timeline-item::before { left: -1.18rem; }
    .timeline-item-clickable { margin-left: 0; margin-right: 0; padding-left: 0.5rem; padding-right: 0.5rem; }

    /* Quote detail — stivuit vertical */
    .quote-document-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .quote-header-row > div:last-child { text-align: left !important; }
    .card[style*="padding:2.5rem"] { padding: 1.25rem !important; }

    /* Client detail grid */
    .client-grid { grid-template-columns: 1fr !important; }

    /* Dashboard grid */
    .dashboard-grid { grid-template-columns: 1fr !important; }

    /* About */
    .about-hero { padding: 1.75rem 1.25rem; }
    .about-grid { grid-template-columns: 1fr; gap: 1rem; }
    .info-block { padding: 1.25rem; }
    .eu-bar { gap: 1rem; flex-direction: column; }

    /* Search bar */
    .search-bar { max-width: 100%; }
    form.flex-gap { flex-direction: column; align-items: stretch; }
    form.flex-gap .btn { width: 100%; }

    /* Filter pills wrap */
    .flex-gap[style*="flex-wrap"] { gap: 0.35rem !important; }

    /* Page title */
    .page-title { font-size: 1.4rem; }

    /* User chip mobile */
    .user-chip { padding: 0.5rem; }

    /* Toast */
    .toast {
        right: 0.75rem;
        left: 0.75rem;
        top: 0.75rem;
        max-width: none;
    }

    /* Stat row inline grids */
    div[style*="grid-template-columns: 320px 1fr"],
    div[style*="grid-template-columns:320px 1fr"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns:repeat"][style*="200px"],
    div[style*="grid-template-columns: repeat"][style*="200px"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Telefoane foarte mici */
@media (max-width: 480px) {
    .main { padding: 1rem 0.75rem 5rem; }
    .card { padding: 0.85rem; }
    .stat-value { font-size: 1.5rem; }
    .page-title { font-size: 1.25rem; }
    .modal-body { padding: 1rem; }
    .modal-header { padding: 0.85rem 1rem; }
    .btn { font-size: 0.85rem; padding: 0.6rem 1rem; }
    .btn-sm { font-size: 0.78rem; padding: 0.45rem 0.75rem; }
    .nav-item { font-size: 0.875rem; }
    .mobile-nav-toggle { width: 48px; height: 48px; bottom: 1rem; right: 1rem; }
}

/* ============================ UTILITY ============================ */
.text-mute { color: var(--text-mute); }
.text-soft { color: var(--text-soft); }
.text-success { color: var(--green-700); }
.text-danger  { color: var(--danger); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.flex-gap { display: flex; gap: 0.5rem; align-items: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Scrollbar refinat */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--green-300); }

/* Loading state */
.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--green-500);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notifications */
.toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green-500);
    border-radius: var(--radius);
    padding: 0.85rem 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 360px;
    animation: slideInRight var(--t-slow) cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.875rem;
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
