/* ────────────────────────────────────────────────────────────
   ScholarshipFinder dashboard (post-login) design system
   Scoped to .dash-* and .s-* so the public landing pages keep
   their own look. Uses the app's indigo palette (app.css).
   ──────────────────────────────────────────────────────────── */
:root {
    --d-bg: #F7F6FC;            /* page background */
    --d-surface: #ffffff;
    --d-primary: #3C3489;       /* brand indigo */
    --d-primary-dark: #26215C;
    --d-violet: #6D5BD0;        /* complementary accent (indigo→violet) */
    --d-teal: #0D9488;          /* complementary accent (matches/success) */
    --d-amber: #C27A0A;         /* complementary accent (awards/deadlines) */
    --d-text: #26215C;          /* text primary */
    --d-text-secondary: #6b6b8a;
    --d-border: #E8E6F5;
    --d-danger: #c0392b;
}

/* Shell */
.dash-shell {
    min-height: 100vh;
    background: var(--d-bg);
    color: var(--d-text);
    font-family: var(--font-sans);
    padding: 12px;
}

.dash-frame {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px -24px rgba(38, 33, 92, 0.35);
    overflow: hidden;
    min-height: calc(100vh - 24px);
}

/* Sidebar */
.dash-sidebar-wrap { flex-shrink: 0; }

.dash-sidebar {
    display: flex;
    flex-direction: column;
    width: 280px;
    height: 100%;
    background: #fff;
    padding-top: 20px;
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px 28px;
}

.dash-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--d-primary);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.dash-logo-text {
    font-weight: 700;
    font-size: 17px;
    color: var(--d-text);
}

.dash-logo-accent { color: var(--d-primary); }

.dash-nav { flex: 1; padding: 0 12px; }

.dash-nav-heading {
    margin: 0 0 8px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--d-text-secondary);
}

.dash-nav ul { list-style: none; margin: 0; padding: 0; }

.dash-nav-item { position: relative; }

.dash-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--d-text-secondary);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.dash-nav-item a:hover { background: var(--d-bg); color: var(--d-text); }

.dash-nav-item.active a {
    background: linear-gradient(135deg, var(--d-primary), var(--d-violet));
    color: #fff;
    font-weight: 800;
}

.dash-nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.dash-sidebar-foot { padding: 40px 28px 24px; font-size: 12px; color: var(--d-text-secondary); }

/* Top bar */
.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 16px 24px;
}

.dash-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 4px;
}

.dash-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--d-primary);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.dash-avatar-lg {
    width: 72px;
    height: 72px;
    font-size: 26px;
    background: var(--d-primary);
}

.dash-user-name { font-weight: 700; font-size: 14px; color: var(--d-text); }

/* Content well */
.dash-content {
    flex: 1;
    background: var(--d-bg);
    border-radius: 20px 0 0 0;
    padding: 32px 24px;
}

.dash-section { margin-bottom: 32px; }

.dash-section-title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--d-text);
}

.dash-section-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 8px;
    background: linear-gradient(135deg, var(--d-primary), var(--d-teal));
}

/* Overview grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dash-card {
    background: var(--d-surface);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(38, 33, 92, 0.08);
}

.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }

/* Profile ring + photo */
.profile-ring {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-ring .ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-track,
.ring-progress { fill: none; stroke-width: 6; }

.ring-track { stroke: var(--d-border); }

.ring-progress {
    stroke: var(--d-teal);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}

.dash-avatar { overflow: hidden; }

.dash-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.photo-edit {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--d-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(38, 33, 92, 0.28);
    overflow: hidden;
}

.photo-edit svg { width: 16px; height: 16px; }

.photo-edit input { display: none; }

.profile-progress {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--d-teal);
}

.dash-name {
    margin: 12px 0 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--d-text);
}

.dash-sub { margin: 0; font-size: 15px; color: var(--d-text-secondary); }

.dash-eligible { margin: 8px 0 0; font-size: 15px; color: var(--d-text); }

.dash-eligible strong { text-decoration: underline; text-underline-offset: 4px; color: var(--d-teal); }

.quick-card h3 { margin: 0 0 16px; font-size: 18px; }

.quick-links { display: flex; flex-direction: column; gap: 10px; }

/* Settings */
.settings-stack { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }

.dash-card h3 { margin: 0 0 16px; font-size: 18px; color: var(--d-text); }

.settings-toggles { display: flex; flex-direction: column; gap: 12px; }

.settings-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* Matching hero */
.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #3C3489 0%, #5B4FBF 60%, #6D5BD0 100%);
    color: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
}

.dash-hero h2 { margin: 0 0 4px; color: #fff; font-size: 20px; }

.dash-hero p { margin: 0; opacity: 0.9; font-size: 14px; line-height: 1.5; }

.dash-hero .btn-light { flex-shrink: 0; }

/* Scholarship cards */
.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.s-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--d-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(38, 33, 92, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.s-card:hover {
    box-shadow: 0 12px 28px -12px rgba(38, 33, 92, 0.28);
}

.s-card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }

.s-card-title {
    margin: 0;
    padding-right: 36px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--d-text);
}

.s-card-meta { margin-top: 4px; padding-right: 36px; font-size: 14px; color: var(--d-text-secondary); font-weight: 600; }

.s-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.s-tag {
    font-size: 11px;
    font-weight: 700;
    background: var(--d-border);
    color: var(--d-primary);
    border-radius: 999px;
    padding: 3px 10px;
}

.s-card-desc {
    margin: 14px 0 0;
    flex: 1;
    font-size: 14px;
    line-height: 1.55;
    color: var(--d-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.s-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.s-award {
    font-size: 18px;
    font-weight: 700;
    color: var(--d-amber);
}

.s-deadline {
    font-size: 12px;
    color: var(--d-text-secondary);
    white-space: nowrap;
}

/* "More options" (⋮) menu */
.s-menu { position: absolute; top: 12px; right: 12px; z-index: 3; }

.s-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--d-border);
    background: #fff;
    color: var(--d-text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.s-menu-btn:hover { color: var(--d-primary); border-color: var(--d-primary); }

.s-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    cursor: default;
}

.s-menu-pop {
    position: absolute;
    top: 34px;
    right: 0;
    z-index: 40;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--d-border);
    border-radius: 10px;
    box-shadow: 0 12px 30px -10px rgba(38, 33, 92, 0.35);
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.s-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--d-text);
    cursor: pointer;
    text-decoration: none;
}

.s-menu-item:hover { background: var(--d-bg); color: var(--d-primary); }

/* Status badge + applications */
.s-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    color: #fff;
}

.dash-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--d-text-secondary);
}

.dash-empty a { color: var(--d-primary); font-weight: 700; }

/* Responsive */
@media (max-width: 1023px) {
    .dash-shell { padding: 8px; }
    .dash-frame { flex-direction: column; border-radius: 16px; }
    .dash-sidebar { width: 100%; padding-top: 12px; }
    .dash-logo { padding-bottom: 12px; }
    .dash-nav-heading { display: none; }
    .dash-nav ul { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px; }
    .dash-nav-item { flex-shrink: 0; }
    .dash-sidebar-foot { display: none; }
    .dash-content { border-radius: 16px 16px 0 0; padding: 24px 16px; }
}
