* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --primary: #0f172a;
    --primary-2: #1e293b;
    --accent: #2563eb;
    --danger: #dc2626;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

body {
    font-family: Montserrat, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

/* SIDEBAR */

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #081225 0%, #0f172a 100%);
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    font-size: 16px;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand-text strong {
    font-size: 18px;
}

.sidebar-brand-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link,
.sidebar-link:visited {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    color: #e5eefc;
    font-size: 15px;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link-danger:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #ffffff;
}

/* APP BODY */

.app-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* TOPBAR */

.topbar {
    height: 78px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    backdrop-filter: blur(8px);
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar-user-info strong {
    font-size: 14px;
}

.topbar-user-info span {
    font-size: 12px;
    color: var(--muted);
    text-transform: capitalize;
}

/* CONTENT */

.page-content {
    padding: 28px;
}

/* DASHBOARD */

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--muted);
    font-size: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

.stat-card p {
    font-size: 14px;
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 18px;
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.panel-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.panel-card p {
    color: var(--muted);
    line-height: 1.5;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.quick-link,
.quick-link:visited {
    display: block;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    transition: all 0.2s ease;
}

.quick-link:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    background: #ffffff;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .topbar {
        padding: 0 18px;
    }

    .page-content {
        padding: 18px;
    }
}

/* =========================
   LOGIN
========================= */

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.12), transparent 28%),
        #f4f7fb;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.login-brand-panel {
    background: linear-gradient(135deg, #081225 0%, #0f172a 60%, #1e3a8a 100%);
    color: #fff;
    padding: 60px;
    display: flex;
    align-items: center;
}

.login-brand-content {
    max-width: 520px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-brand-content h1 {
    font-size: 46px;
    line-height: 1.08;
    margin-bottom: 18px;
}

.login-brand-content p {
    font-size: 17px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 28px;
}

.login-feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.login-feature-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #60a5fa;
    flex-shrink: 0;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(12px);
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.login-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.18);
}

.login-card-header h2 {
    font-size: 28px;
    margin-bottom: 4px;
}

.login-card-header p {
    font-size: 14px;
    color: var(--muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    height: 52px;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: 0 16px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

.btn-primary {
    height: 54px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 28px rgba(29, 78, 216, 0.18);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(29, 78, 216, 0.22);
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        padding: 42px 28px;
    }

    .login-brand-content h1 {
        font-size: 34px;
    }

    .login-form-panel {
        padding: 24px;
    }
}
.alert-error {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.18);
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.45;
}
/* =========================
   PROFILE
========================= */

.profile-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.profile-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.profile-cover {
    position: relative;
    height: 180px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.92)),
        linear-gradient(90deg, #1d4ed8 0%, #0f172a 100%);
    overflow: hidden;
    z-index: 1;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 0 24px 24px;
    margin-top: -42px;
}

.profile-avatar {
    width: 108px;
    height: 108px;
    border-radius: 24px;
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    border: 5px solid #fff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    z-index: 3;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-main-info {
    flex: 1;
    padding-top:50px;
    padding-bottom: 6px;
}

.profile-main-info h1 {
    font-size: 30px;
    margin-bottom: 6px;
}

.profile-role {
    font-size: 15px;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 6px;
}

.profile-email {
    font-size: 14px;
    color: var(--muted);
}

.profile-actions {
    padding-bottom: 6px;
}

.btn-secondary {
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    padding: 0 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.profile-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-info-item span {
    font-size: 13px;
    color: var(--muted);
}

.profile-info-item strong {
    font-size: 15px;
    color: var(--text);
}

.profile-bio {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.7;
}

.profile-form-card h3 {
    margin-bottom: 8px;
}

.profile-form-intro {
    color: var(--muted);
    margin-bottom: 22px;
    line-height: 1.6;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.profile-form textarea {
    width: 100%;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    outline: none;
    resize: vertical;
    transition: all 0.2s ease;
    font-family: Arial, Helvetica, sans-serif;
}

.profile-form textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

.profile-form-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 980px) {
    .profile-main-info{
        padding-top:0px;
    }
    .profile-grid,
    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-actions {
        width: 100%;
    }
}
.alert-success {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.18);
    color: #15803d;
    font-size: 14px;
    line-height: 1.45;
}
.profile-cover {
    position: relative;
    height: 180px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.92)),
        linear-gradient(90deg, #1d4ed8 0%, #0f172a 100%);
    overflow: hidden;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar {
    width: 108px;
    height: 108px;
    border-radius: 24px;
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    border: 5px solid #fff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.topbar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    overflow: hidden;
}

.topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-edit-section {
    display: none;
    flex-direction: column;
    gap: 22px;
}

.profile-page.is-editing .profile-edit-section {
    display: flex;
}

.profile-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.btn-cancel-edit {
    flex-shrink: 0;
}

@media (max-width: 980px) {
    .profile-edit-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-cancel-edit {
        width: 100%;
    }
}
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-left: 5px solid #94a3b8;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.28s ease;
    pointer-events: auto;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-content strong {
    font-size: 14px;
    line-height: 1.2;
    color: var(--text);
}

.toast-content span {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.45;
}

.toast-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text);
}

.toast-success {
    border-left-color: #16a34a;
}

.toast-error {
    border-left-color: #dc2626;
}

.toast-info {
    border-left-color: #2563eb;
}

@media (max-width: 640px) {
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}
