/* ═══════════════════════════════════════════════════════════════════════════
   KMSoft User Portal – portal.css
   Prefix: p-  (portal osztályok)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --p-primary:        #7BBA40;
    --p-primary-dark:   #5a9a1f;
    --p-primary-light:  rgba(123, 186, 64, 0.08);
    --p-secondary:      #323D37;
    --p-surface:        #ffffff;
    --p-surface-alt:    #f8faf6;
    --p-border:         rgba(50, 61, 55, 0.12);
    --p-text:           #1a1f1c;
    --p-text-muted:     #5c6860;
    --p-danger:         #e74c3c;
    --p-success:        #28ca41;
    --p-warning:        #f0a500;
    --p-sidebar-bg:     #323D37;
    --p-sidebar-text:   rgba(255, 255, 255, 0.65);
    --p-sidebar-active: rgba(123, 186, 64, 0.18);
    --p-sidebar-hover:  rgba(255, 255, 255, 0.06);
    --p-sidebar-width:  260px;
    --p-topbar-height:  0px;
    --p-radius-sm:      6px;
    --p-radius-md:      10px;
    --p-radius-lg:      16px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--p-surface-alt);
    color: var(--p-text);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--p-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.p-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.p-sidebar {
    width: var(--p-sidebar-width);
    background: var(--p-sidebar-bg);
    color: var(--p-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease;
}

.p-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1.25rem 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
}
.p-sidebar-logo:hover { text-decoration: none; color: #fff; }
.p-sidebar-logo svg { color: var(--p-primary); }

.p-sidebar-user {
    padding: 0 1.25rem 1rem;
    font-size: 0.78rem;
    color: var(--p-sidebar-text);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
}
.p-sidebar-user-nev {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.85rem;
}
.p-sidebar-user-email {
    color: var(--p-sidebar-text);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Nav csoportok */
.p-sidebar-nav {
    flex: 1;
    padding: 0.25rem 0;
}
.p-sidebar-group {
    padding: 0.25rem 0;
}
.p-sidebar-group + .p-sidebar-group {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 0.25rem;
    padding-top: 0.5rem;
}
.p-sidebar-group-label {
    padding: 0.4rem 1.25rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148,163,184,0.5);
}

/* Nav elem */
.p-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--p-sidebar-text);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.p-sidebar-item:hover {
    background: var(--p-sidebar-hover);
    color: #e2e8f0;
    text-decoration: none;
}
.p-sidebar-item.p-active {
    background: var(--p-sidebar-active);
    color: #fff;
}
.p-sidebar-item.p-active svg { color: var(--p-primary); }
.p-sidebar-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.p-sidebar-item:hover svg { opacity: 1; }
.p-sidebar-item.p-active svg { opacity: 1; }

/* Almenü (összecsukható) */
.p-sidebar-sub {
    display: none;
    padding-left: 1rem;
}
.p-sidebar-sub.p-open { display: block; }
.p-sidebar-toggle-arrow {
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.5;
}
.p-sidebar-sub.p-open ~ .p-sidebar-item .p-sidebar-toggle-arrow,
.p-sidebar-item[aria-expanded="true"] .p-sidebar-toggle-arrow {
    transform: rotate(180deg);
}

/* Kilépés */
.p-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.5rem 0;
    margin-top: auto;
}
.p-sidebar-item.p-logout {
    color: rgba(239,68,68,0.7);
}
.p-sidebar-item.p-logout:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.08);
}

/* ── Main content ─────────────────────────────────────────────────────────── */
.p-main {
    flex: 1;
    margin-left: var(--p-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.p-content {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem;
}

/* Mobile topbar (rejtett desktopon) */
.p-mobile-topbar {
    display: none;
    align-items: center;
    padding: 0 1rem;
    height: 52px;
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
    position: sticky;
    top: 0;
    z-index: 90;
}
.p-mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--p-text);
    padding: 0.4rem;
    border-radius: var(--p-radius-sm);
}
.p-mobile-toggle:hover { background: var(--p-surface-alt); }
.p-mobile-title {
    margin-left: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Sidebar overlay (mobil) */
.p-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.p-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.p-page-title {
    font-size: 1.35rem;
    font-weight: 700;
}
.p-page-subtitle {
    font-size: 0.85rem;
    color: var(--p-text-muted);
    margin-top: 0.15rem;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.p-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.p-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.p-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.p-card-body { }

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.p-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Stat kártyák */
.p-stat {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 1.1rem 1.25rem;
}
.p-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--p-text-muted);
    margin-bottom: 0.35rem;
}
.p-stat-value { font-size: 1.2rem; font-weight: 700; }
.p-stat-sub { font-size: 0.78rem; color: var(--p-text-muted); margin-top: 0.2rem; }

/* ── Badge ────────────────────────────────────────────────────────────────── */
.p-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.p-badge-green  { background: rgba(34,197,94,0.12);  color: #16a34a; border: 1px solid rgba(34,197,94,0.25); }
.p-badge-blue   { background: rgba(37,99,235,0.1);   color: var(--p-primary); border: 1px solid rgba(37,99,235,0.25); }
.p-badge-orange { background: rgba(245,158,11,0.12); color: #b45309; border: 1px solid rgba(245,158,11,0.25); }
.p-badge-red    { background: rgba(239,68,68,0.1);   color: #dc2626; border: 1px solid rgba(239,68,68,0.25); }
.p-badge-gray   { background: rgba(100,116,139,0.1); color: #64748b; border: 1px solid rgba(100,116,139,0.2); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.p-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--p-radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.p-alert-ok      { background: rgba(34,197,94,0.1);  color: #16a34a; border: 1px solid rgba(34,197,94,0.25); }
.p-alert-hiba    { background: rgba(239,68,68,0.1);  color: #dc2626; border: 1px solid rgba(239,68,68,0.25); }
.p-alert-warning { background: rgba(245,158,11,0.1); color: #b45309; border: 1px solid rgba(245,158,11,0.25); }
.p-alert-info    { background: rgba(37,99,235,0.08); color: var(--p-primary); border: 1px solid rgba(37,99,235,0.2); }

/* ── Form ─────────────────────────────────────────────────────────────────── */
.p-form-group { margin-bottom: 1rem; }
.p-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--p-text-muted);
    margin-bottom: 0.35rem;
}
.p-form-group label .p-required { color: var(--p-danger); }

.p-input, .p-select, .p-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-md);
    background: var(--p-surface);
    color: var(--p-text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.p-input:focus, .p-select:focus, .p-textarea:focus {
    outline: none;
    border-color: var(--p-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.p-textarea { resize: vertical; min-height: 100px; }
.p-input:disabled, .p-select:disabled {
    background: var(--p-surface-alt);
    cursor: not-allowed;
    opacity: 0.7;
}

.p-form-hint {
    font-size: 0.75rem;
    color: var(--p-text-muted);
    margin-top: 0.25rem;
}
.p-form-error {
    font-size: 0.75rem;
    color: var(--p-danger);
    margin-top: 0.25rem;
}

.p-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.p-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--p-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity 0.15s, background 0.15s;
    text-decoration: none;
}
.p-btn:hover { opacity: 0.88; text-decoration: none; }
.p-btn-primary { background: var(--p-primary); color: #fff; }
.p-btn-primary:hover { background: var(--p-primary-dark); opacity: 1; }
.p-btn-secondary {
    background: transparent;
    color: var(--p-text);
    border: 1px solid var(--p-border);
}
.p-btn-secondary:hover { background: var(--p-surface-alt); opacity: 1; }
.p-btn-danger { background: var(--p-danger); color: #fff; }
.p-btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.p-btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }
.p-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.p-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
}
.p-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}
.p-table th {
    padding: 0.55rem 0.85rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--p-text-muted);
    border-bottom: 2px solid var(--p-border);
    background: var(--p-surface);
    white-space: nowrap;
}
.p-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--p-border);
    vertical-align: middle;
}
.p-table tr:last-child td { border-bottom: none; }
.p-table tbody tr:hover td { background: var(--p-surface-alt); }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.p-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--p-text-muted);
}
.p-empty svg { margin-bottom: 0.75rem; opacity: 0.4; }
.p-empty-title { font-weight: 600; font-size: 1rem; color: var(--p-text); margin-bottom: 0.25rem; }
.p-empty-text { font-size: 0.85rem; margin-bottom: 1rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.p-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.75rem;
    color: var(--p-text-muted);
    border-top: 1px solid var(--p-border);
    background: var(--p-surface);
}
.p-footer a { color: var(--p-text-muted); }
.p-footer a:hover { color: var(--p-primary); }

/* ── Email verify banner ──────────────────────────────────────────────────── */
.p-verify-banner {
    background: rgba(245,158,11,0.1);
    border-bottom: 1px solid rgba(245,158,11,0.25);
    color: #92400e;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.p-verify-banner a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .p-sidebar {
        transform: translateX(-100%);
    }
    .p-sidebar.p-sidebar-open {
        transform: translateX(0);
    }
    .p-sidebar-overlay.p-visible {
        display: block;
    }
    .p-main {
        margin-left: 0;
    }
    .p-mobile-topbar {
        display: flex;
    }
    .p-content {
        padding: 1.25rem 1rem;
    }
    .p-form-row {
        grid-template-columns: 1fr;
    }
}

/* ── Login oldal (nem sidebar layout) ─────────────────────────────────────── */
.p-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--p-surface-alt);
}
.p-login-box {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.p-login-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--p-primary);
    margin-bottom: 0.35rem;
}
.p-login-subtitle {
    font-size: 0.85rem;
    color: var(--p-text-muted);
    margin-bottom: 2rem;
}
.p-login-footer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--p-text-muted);
    margin-top: 1.5rem;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.p-mt-0 { margin-top: 0; }
.p-mt-1 { margin-top: 0.5rem; }
.p-mt-2 { margin-top: 1rem; }
.p-mb-0 { margin-bottom: 0; }
.p-mb-1 { margin-bottom: 0.5rem; }
.p-mb-2 { margin-bottom: 1rem; }
.p-text-muted { color: var(--p-text-muted); }
.p-text-sm { font-size: 0.85rem; }
.p-text-center { text-align: center; }
.p-flex { display: flex; }
.p-flex-between { justify-content: space-between; }
.p-flex-center { align-items: center; }
.p-gap-1 { gap: 0.5rem; }
.p-gap-2 { gap: 1rem; }
