/*
 * CégPult – Design System v2.0
 * Stílus: meleg krém / barna / arany
 * Betűtípus: Cormorant Garamond + DM Sans
 * Elhelyezés: assets/css/style.css
 */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ===========================
   CSS VÁLTOZÓK
   =========================== */
:root {
    --bg:           #F5EFE2;
    --bg-dark:      #EDE3CE;
    --white:        #FDFAF5;
    --border:       #DDD0BC;
    --border-light: #EDE7D8;

    --text-dark:    #1C0F0A;
    --text-mid:     #4A3020;
    --text-light:   #7A6050;
    --text-faint:   #A89080;

    --sidebar-bg:      #2C1A0E;
    --sidebar-hover:   rgba(255,255,255,0.06);
    --sidebar-active:  rgba(184,115,51,0.22);
    --sidebar-border:  rgba(255,255,255,0.08);

    --copper:      #B87333;
    --copper-dark: #9A6020;
    --gold:        #C8A84B;
    --gold-dark:   #A8882B;

    --status-varakozik-bg:  #fef3c7; --status-varakozik:  #92400e;
    --status-jovahagyva-bg: #dcfce7; --status-jovahagyva: #166534;
    --status-elutasitva-bg: #fee2e2; --status-elutasitva: #991b1b;
    --status-teljesitve-bg: #ede9fe; --status-teljesitve: #5b21b6;

    --shadow-sm: 0 1px 3px rgba(44,26,14,0.07);
    --shadow-md: 0 4px 14px rgba(44,26,14,0.09);

    --sidebar-width: 240px;
    --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
}

/* ===========================
   RESET + ALAP
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.65;
}
a { color: var(--copper); text-decoration: none; }
a:hover { color: var(--copper-dark); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===========================
   TIPOGRÁFIA
   =========================== */
.serif, h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
}
h1 { font-size: 32px; color: var(--text-dark); line-height: 1.1; }
h2 { font-size: 24px; color: var(--text-dark); line-height: 1.15; }
h3 { font-size: 20px; color: var(--text-dark); }

/* ===========================
   LAYOUT
   =========================== */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page-container { padding: 2rem; max-width: 1100px; width: 100%; }

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}
.sidebar-header { padding: 1.5rem 1.25rem 1rem; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-back {
    display: flex; align-items: center; gap: 5px;
    color: rgba(255,255,255,.3); font-size: 11px; text-decoration: none;
    margin-bottom: 14px; transition: color .15s;
}
.sidebar-back:hover { color: rgba(255,255,255,.6); }
.sidebar-back svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-logo-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--copper), var(--gold));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 700; color: var(--sidebar-bg);
}
.sidebar-logo-name { font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 600; color: white; line-height: 1.1; display: block; }
.sidebar-logo-sub { font-size: 10px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .1em; display: block; }

.sidebar-user { padding: 1rem 1.25rem; border-bottom: 1px solid var(--sidebar-border); display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--copper), var(--gold));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 700; color: var(--sidebar-bg); flex-shrink: 0;
}
.sidebar-user-name { color: white; font-size: 13px; font-weight: 500; line-height: 1.2; }
.sidebar-user-role { color: rgba(255,255,255,.4); font-size: 11px; }

.sidebar-nav { padding: .75rem 0; flex: 1; overflow-y: auto; }
.sidebar-nav-section {
    padding: .625rem 1.25rem .25rem;
    font-size: 10px; font-weight: 600; color: rgba(255,255,255,.25);
    text-transform: uppercase; letter-spacing: .1em;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: .625rem 1.25rem;
    color: rgba(255,255,255,.55); font-size: 13px;
    text-decoration: none; transition: all .15s;
}
.sidebar-nav a:hover { color: white; background: var(--sidebar-hover); }
.sidebar-nav a.active { color: white; background: var(--sidebar-active); border-right: 2px solid var(--copper); }
.sidebar-nav svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.sidebar-nav .nav-badge {
    margin-left: auto; background: var(--copper); color: white;
    font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 10px;
}
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--sidebar-border); }
.sidebar-footer a {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.3); font-size: 12px; text-decoration: none; padding: .375rem 0; transition: color .15s;
}
.sidebar-footer a:hover { color: rgba(255,255,255,.65); }
.sidebar-footer svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ===========================
   OLDAL FEJLÉC
   =========================== */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.page-header h1 { font-family: 'Cormorant Garamond', serif; font-size: 32px; }
.page-sub, .page-subtitle { font-size: 13px; color: var(--text-light); margin-top: 3px; }

/* ===========================
   KPI KÁRTYÁK (dashboard)
   =========================== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.kpi-card {
    background: var(--white); border-radius: var(--r-md);
    border: 1px solid var(--border); border-left: 3px solid var(--copper);
    padding: 1.25rem 1.5rem; box-shadow: var(--shadow-sm);
}
.kpi-card.kpi-gold    { border-left-color: var(--gold); }
.kpi-card.kpi-green   { border-left-color: #166534; }
.kpi-card.kpi-red     { border-left-color: #991b1b; }
.kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); margin-bottom: 8px; }
.kpi-value { font-family: 'Cormorant Garamond', serif; font-size: 38px; font-weight: 600; color: var(--text-dark); line-height: 1; }
.kpi-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===========================
   KÁRTYÁK
   =========================== */
.card {
    background: var(--white); border-radius: var(--r-md);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 1.5rem;
}
.card-body { padding: 1.5rem; }
.card-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; color: var(--text-dark); }

/* ===========================
   GOMBOK
   =========================== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--r-sm);
    font-size: 13px; font-weight: 500; font-family: 'DM Sans', sans-serif;
    cursor: pointer; border: none; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-gold   { background: linear-gradient(135deg, var(--copper), var(--gold)); color: var(--sidebar-bg); font-weight: 600; }
.btn-gold:hover { opacity: .9; color: var(--sidebar-bg); }
.btn-dark   { background: var(--sidebar-bg); color: white; }
.btn-dark:hover { background: #3D2514; color: white; }
.btn-primary { background: var(--sidebar-bg); color: white; }
.btn-primary:hover { background: #3D2514; color: white; }
.btn-outline { background: var(--white); color: var(--text-mid); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--copper); color: var(--copper); }
.btn-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.btn-success:hover { background: #bbf7d0; color: #166534; }
.btn-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.btn-danger:hover  { background: #fecaca; color: #991b1b; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

/* ===========================
   TÁBLÁZAT
   =========================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    padding: 10px 16px; text-align: left;
    font-size: 10px; font-weight: 600; color: var(--text-light);
    text-transform: uppercase; letter-spacing: .07em;
    border-bottom: 2px solid var(--border-light); background: var(--bg);
    white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-mid); }
tbody tr:hover td { background: rgba(184,115,51,.04); }
tbody tr:last-child td { border-bottom: none; }
tfoot td { padding: 12px 16px; border-top: 2px solid var(--border-light); }
.rendelesszam { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--copper); font-weight: 500; }
.osszeg { font-family: 'Cormorant Garamond', serif; font-size: 16px; font-weight: 600; color: var(--text-dark); }

/* ===========================
   FORM
   =========================== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-mid); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 13px;
    border: 1px solid var(--border); border-radius: var(--r-sm);
    font-size: 13px; font-family: 'DM Sans', sans-serif;
    color: var(--text-dark); background: var(--white); transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--copper);
    box-shadow: 0 0 0 3px rgba(184,115,51,.12);
}
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 2fr 90px 90px 130px auto; gap: .5rem; align-items: end; }
.required { color: #C62828; }

/* ===========================
   STÁTUSZ BADGE-EK
   =========================== */
.badge-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-status::before { content: '●'; font-size: 8px; }
.badge-varakozik  { background: var(--status-varakozik-bg);  color: var(--status-varakozik); }
.badge-jovahagyva { background: var(--status-jovahagyva-bg); color: var(--status-jovahagyva); }
.badge-elutasitva { background: var(--status-elutasitva-bg); color: var(--status-elutasitva); }
.badge-teljesitve { background: var(--status-teljesitve-bg); color: var(--status-teljesitve); }

/* Kategória pill */
.kat-pill {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 500;
    background: rgba(184,115,51,.12); color: var(--copper);
}

/* ===========================
   FLASH ÜZENETEK
   =========================== */
.flash { padding: 13px 16px; border-radius: var(--r-sm); margin-bottom: 1.5rem; font-size: 13px; border-left: 3px solid; }
.flash-success { background: #f0fdf4; color: #166534; border-color: #166534; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #991b1b; }
.flash-info    { background: #fffbeb; color: #92400e; border-color: var(--gold); }

/* ===========================
   SZŰRŐ SÁV
   =========================== */
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 130px; }

/* ===========================
   ÜRES ÁLLAPOT
   =========================== */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--text-light); }
.empty-state svg { width: 48px; height: 48px; stroke: currentColor; fill: none; stroke-width: 1.5; margin: 0 auto 1rem; display: block; opacity: .4; }
.empty-state p { font-size: 14px; margin-bottom: 1.25rem; }

/* ===========================
   MOBIL
   =========================== */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(28,15,10,.55); z-index: 40; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -240px; top: 0; height: 100vh; z-index: 50; transition: left .25s; }
    .sidebar.open { left: 0; }
    .sidebar-overlay.open { display: block; }
    .mobile-topbar {
        display: flex; align-items: center; gap: 12px;
        background: var(--sidebar-bg); padding: .875rem 1rem;
        position: sticky; top: 0; z-index: 30;
    }
    .mobile-topbar svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2; cursor: pointer; }
    .mobile-topbar-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: white; font-weight: 600; }
    .page-container { padding: 1rem; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .hide-mobile { display: none; }
    .show-mobile { display: block; }
}
@media (min-width: 769px) {
    .show-mobile { display: none; }
}
