/* =============================================================================
   VEZTRAA ADMIN PORTAL - Custom Stylesheet
   Design: Corporate, clean, professional
   Base: Bootstrap 5.3
   ============================================================================= */

/* ---- CSS Variables ---- */
:root {
    --sidebar-width:      240px;
    --sidebar-bg:         #1a1f2e;
    --sidebar-hover:      rgba(255,255,255,0.07);
    --sidebar-active:     rgba(99,102,241,0.2);
    --sidebar-active-bar: #6366f1;
    --topbar-height:      60px;
    --topbar-bg:          #ffffff;
    --topbar-border:      #e5e7eb;
    --body-bg:            #f3f4f6;
    --card-bg:            #ffffff;
    --card-border:        #e5e7eb;
    --card-header-bg:     #f9fafb;
    --text-primary:       #111827;
    --text-muted:         #6b7280;
    --accent:             #6366f1;
    --accent-dark:        #4f46e5;
    --font:               'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.sidebar-logo {
    width: 148px;
    height: auto;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    padding: 0.5rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255,255,255,0.65);
    padding: 0.55rem 0.75rem;
    border-radius: 7px;
    margin-bottom: 2px;
    font-size: 0.83rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    width: 1.1rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #a5b4fc;
    border-left: 3px solid var(--sidebar-active-bar);
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    position: sticky; top: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 900;
    gap: 1rem;
}

/* ---- Left ---- */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.sidebar-toggle {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--topbar-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sidebar-toggle:hover {
    background: var(--body-bg);
    color: var(--text-primary);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.breadcrumb-org {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-sep {
    color: #d1d5db;
    font-size: 0.65rem;
}

.breadcrumb-page {
    color: var(--text-primary);
    font-weight: 600;
}

/* ---- Right ---- */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topbar-date {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    background: var(--body-bg);
    border: 1px solid var(--topbar-border);
    border-radius: 8px;
    white-space: nowrap;
}

.topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--topbar-border);
    margin: 0 0.25rem;
}

/* ---- Profile button ---- */
.topbar-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: 1px solid var(--topbar-border);
    border-radius: 10px;
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.topbar-profile-btn:hover,
.topbar-profile-btn.show {
    background: var(--body-bg);
    border-color: #c9cdd4;
}

.topbar-avatar {
    width: 30px; height: 30px;
    background: var(--accent);
    color: white;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.topbar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.topbar-user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.topbar-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.1rem;
}

/* ---- Dropdown ---- */
.topbar-dropdown {
    min-width: 220px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    padding: 0.5rem;
    overflow: hidden;
}

.topbar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    pointer-events: none;
}

.td-avatar {
    width: 36px; height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.td-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.td-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.topbar-dd-item {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary) !important;
    padding: 0.55rem 0.75rem !important;
    border-radius: 8px !important;
    transition: background 0.12s ease;
}

.topbar-dd-item i {
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 1rem;
    text-align: center;
}

.topbar-dd-item:hover { background: var(--body-bg) !important; }

.topbar-dd-logout { color: #dc2626 !important; }
.topbar-dd-logout i { color: #dc2626; }
.topbar-dd-logout:hover { background: #fef2f2 !important; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    flex: 1;
    padding: 1.75rem 2rem;
    width: 100%;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.83rem;
}

.alert-flash {
    margin-bottom: 1.25rem;
    border-radius: 10px;
}

/* ============================================================
   USER AVATAR
   ============================================================ */
.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-avatar--sm { width: 28px; height: 28px; font-size: 0.7rem; }
.user-avatar--lg { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 16px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.15s ease;
}

.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.stat-card__icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.stat-card__label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.stat-card--blue  .stat-card__icon { background: #eff6ff; color: #3b82f6; }
.stat-card--orange .stat-card__icon { background: #fff7ed; color: #f97316; }
.stat-card--green .stat-card__icon { background: #f0fdf4; color: #22c55e; }
.stat-card--purple .stat-card__icon { background: #f5f3ff; color: #8b5cf6; }

/* ============================================================
   CARDS
   ============================================================ */
.card-portal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
}

.card-header-portal {
    padding: 0.85rem 1.25rem;
    background: var(--card-header-bg);
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-primary);
}

.card-footer-portal {
    padding: 0.75rem 1.25rem;
    background: var(--card-header-bg);
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-portal {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    margin: 0;
}

.table-portal thead tr {
    background: var(--card-header-bg);
    border-bottom: 1px solid var(--card-border);
}

.table-portal th {
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border: none;
    white-space: nowrap;
}

.table-portal td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: var(--text-primary);
}

.table-portal tbody tr:hover { background: #fafafa; }
.table-portal tbody tr:last-child td { border-bottom: none; }

.row-unread { background: #fefce8; }
.row-unread:hover { background: #fef9c3 !important; }

.empty-state {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
    padding: 0.3em 0.7em;
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

.badge-status-new         { background: #eff6ff; color: #1d4ed8; }
.badge-status-progress    { background: #fff7ed; color: #c2410c; }
.badge-status-closed      { background: #f0fdf4; color: #15803d; }
.badge-status-spam        { background: #fef2f2; color: #b91c1c; }
.badge-status-review      { background: #fefce8; color: #92400e; }
.badge-status-shortlisted { background: #f0fdf4; color: #166534; }
.badge-status-interviewed { background: #f5f3ff; color: #5b21b6; }
.badge-status-selected    { background: #dcfce7; color: #15803d; }
.badge-status-rejected    { background: #fee2e2; color: #991b1b; }
.badge-status-hold        { background: #f1f5f9; color: #475569; }

/* ============================================================
   MISC COMPONENTS
   ============================================================ */
.ref-link {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.ref-link:hover { text-decoration: underline; }

.unread-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: #f97316;
    border-radius: 50%;
    vertical-align: middle;
}

.btn-xs {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    font-weight: 500;
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1.25rem;
    margin: 0;
}

.detail-list dt {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.detail-list dd {
    color: var(--text-primary);
    font-size: 0.83rem;
    margin: 0;
    word-break: break-word;
}

.notes-list { max-height: 340px; overflow-y: auto; }

.note-item {
    padding: 0.75rem;
    background: var(--body-bg);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    border-left: 3px solid var(--accent);
}

.note-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
}

.note-body { font-size: 0.83rem; color: var(--text-primary); }

.status-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    padding: 1rem 1.25rem;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.status-item strong { font-size: 1.25rem; font-weight: 700; }

.permission-group__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--card-border);
}

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-body {
    background: linear-gradient(135deg, #f0f4ff 0%, #f3f4f6 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-wrapper { width: 100%; max-width: 420px; }

.auth-card {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.auth-header { text-align: center; margin-bottom: 1.75rem; }

.auth-logo-img {
    width: 160px;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem;
}

.btn-auth { padding: 0.65rem; font-weight: 600; border-radius: 10px; }

.auth-footer-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 1.25rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #d1d5db;
    font-size: 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-label { font-weight: 600; font-size: 0.8rem; color: #374151; margin-bottom: 0.35rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .page-content {
        padding: 1.25rem 1rem;
    }

    .table-portal th, .table-portal td {
        padding: 0.65rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .auth-card { padding: 1.75rem 1.25rem; }
}

/* ============================================================
   SCROLLBAR (WebKit)
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
