/* DigiSTAG - Minimal white theme */
:root {
    --primary-color: #2563eb;
    --primary-soft: #eff4ff;
    --primary-light: #dbe7ff;
    --text-color: #0f172a;
    --muted-color: #64748b;
    --border-color: #e2e8f0;
    --surface-color: #ffffff;
    --background-color: #f8fafc;
    --success-color: #22c55e;
    --warning-color: #f97316;
    --danger-color: #ef4444;
    --sidebar-width: 260px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background-color);
    color: var(--text-color);
    font-family: inherit;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn,
.form-control,
.card,
.table,
.badge {
    border-radius: 0.85rem;
}

.btn-dark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-dark:hover {
    background: #1d4fd8;
    border-color: #1d4fd8;
}

.btn-outline-dark {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-dark:hover {
    background: var(--primary-color);
    color: #fff;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    margin-bottom: 1.5rem;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-meta {
    margin-left: 0.5rem;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    font-size: 0.85rem;
    color: var(--muted-color);
}

.top-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--muted-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.top-icon-btn:hover {
    background: var(--primary-soft);
    color: var(--primary-color);
}

.search-field {
    position: relative;
}

.search-field input {
    border-radius: 999px;
    padding-left: 3rem;
    min-width: 280px;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.search-field i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-color);
}


.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.user-chip .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
}

.user-chip .avatar.has-photo,
.user-avatar.has-photo {
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.user-chip .avatar img,
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1.25rem 2rem;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

.sidebar-brand i {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-profile {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface-color);
}

.sidebar-profile h6 {
    margin: 0;
    font-weight: 600;
}

.sidebar-profile p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted-color);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.sidebar-divider {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--muted-color);
    padding: 1rem 0 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--muted-color);
    border-radius: 0.75rem;
    transition: background 0.15s ease;
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1.05rem;
    color: var(--primary-color);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--primary-soft);
    color: var(--text-color);
}

.sidebar-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-actions .btn {
    border-radius: 0.85rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
}
.stat-card {
    padding: 1.35rem;
    border-radius: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.stat-icon.primary { background: #2563eb; }
.stat-icon.success { background: #22c55e; }
.stat-icon.warning { background: #f97316; }
.stat-icon.info { background: #0ea5e9; }

.stat-content h3 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
}

.stat-content p {
    margin: 0;
    color: var(--muted-color);
}

.card {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
    background: var(--surface-color);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.table thead {
    background: transparent;
    color: var(--muted-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: #f5f7fb;
}

.badge {
    font-weight: 600;
    border-radius: 999px;
}

.badge.bg-warning { color: #7a4d05; }
.badge.bg-success { color: #0f5132; }
.badge.bg-info { color: #055160; }

.menu-toggle {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.35rem 0.75rem;
    background: var(--surface-color);
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
    .search-field input {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1200;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .search-field input {
        width: 180px;
    }
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,0,0,0.1);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* QR Code Display */
.qr-display {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.qr-display img {
    max-width: 100%;
    height: auto;
}

/* STAG Grid */
.stag-grid {
    overflow-x: auto;
    background: white;
    padding: 1rem;
    border-radius: 8px;
}

.stag-grid table {
    min-width: 600px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 120px;
}

/* Alert Custom */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Profile Page */
.profile-page {
    background: var(--background-color);
    min-height: 100vh;
}

.profile-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    background: var(--surface-color);
}

.profile-hero .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--muted-color);
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 600;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card .form-text {
    font-size: 0.85rem;
    color: var(--muted-color);
}

.profile-card .btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 768px) {
    .profile-hero {
        flex-direction: column;
        text-align: center;
    }

    .avatar-preview {
        width: 96px;
        height: 96px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-bar,
    .mobile-bottom-nav,
    .action-buttons,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
}
