@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --purple:       #6C5CE7;
    --purple-light: #EEE9FF;
    --purple-mid:   #A89BF0;
    --green:        #00B894;
    --green-light:  #E0F8F3;
    --amber:        #FDCB6E;
    --amber-light:  #FFF8E8;
    --red:          #E17055;
    --red-light:    #FEF0EC;
    --blue:         #0984E3;
    --blue-light:   #E8F4FD;
    --gray50:       #F9F8FF;
    --gray100:      #F0EFF8;
    --gray200:      #E2E0F0;
    --gray400:      #9D9AB5;
    --gray600:      #5C5877;
    --gray900:      #1A1828;
    --nav-h:        54px;
    --sidebar-w:    220px;
    --radius:       10px;
    --radius-lg:    14px;
    --shadow:       0 1px 4px rgba(108,92,231,.08), 0 4px 20px rgba(108,92,231,.06);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray50);
    color: var(--gray900);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ── */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--gray200);
    height: var(--nav-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 var(--gray200);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--gray900);
    text-decoration: none;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray600);
    font-weight: 500;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--purple-light);
    color: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.notif-bell {
    position: relative;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}

.notif-bubble {
    position: absolute;
    top: -5px;
    right: -6px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── HAMBURGER ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
    border-radius: 6px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray600);
    border-radius: 2px;
    transition: all .2s;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-h);
    background: rgba(26, 24, 40, .35);
    z-index: 199;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

/* ── LAYOUT ── */
.layout {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--gray200);
    padding: 12px 0 24px;
    flex-shrink: 0;
    position: sticky;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow-y: auto;
}

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

.nav-section {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gray400);
    padding: 12px 20px 4px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--gray400);
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
    text-decoration: none;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray50);
    color: var(--gray900);
    text-decoration: none;
}

.nav-item.active {
    background: var(--purple-light);
    color: var(--purple);
    border-left-color: var(--purple);
    font-weight: 600;
}

.nav-badge {
    margin-left: auto;
    background: var(--purple);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.4;
}

.nav-badge.amber { background: var(--amber); color: #7a5a00; }
.nav-badge.red   { background: var(--red);   color: #fff; }

/* ── MAIN CONTENT ── */
.main-content {
    flex: 1;
    padding: 28px 32px 48px;
    min-width: 0;
    max-width: 960px;
}

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 24px; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray900);
    margin-bottom: 3px;
}

.page-sub { font-size: 13px; color: var(--gray400); }

/* ── METRIC GRID ── */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ── METRIC CARD ── */
.metric {
    background: #fff;
    border: 1px solid var(--gray200);
    border-radius: var(--radius-lg);
    padding: 18px 20px 16px;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}

.metric:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(108,92,231,.12);
}

.metric-label {
    font-size: 11px;
    color: var(--gray400);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
}

.metric-val {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: var(--gray900);
}

.metric-val.c-purple { color: var(--purple); }
.metric-val.c-green  { color: var(--green);  }
.metric-val.c-amber  { color: #c9930a;       }
.metric-val.c-red    { color: var(--red);    }
.metric-val.c-blue   { color: var(--blue);   }

/* ── CARD ── */
.card {
    background: #fff;
    border: 1px solid var(--gray200);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray900);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .01em;
}

.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-green  { background: var(--green-light);  color: #007a63;      }
.badge-amber  { background: var(--amber-light);  color: #956c00;      }
.badge-red    { background: var(--red-light);    color: #c0410e;      }
.badge-gray   { background: var(--gray100);      color: var(--gray400); }
.badge-blue   { background: var(--blue-light);   color: var(--blue);  }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid var(--gray200);
    background: #fff;
    color: var(--gray600);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:hover { background: var(--gray50); text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn-primary:hover { background: #5849c9; border-color: #5849c9; }

.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #009d7e; }

.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #c45e45; }

.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); }

.btn-sm  { padding: 6px 13px; font-size: 12.5px; }
.btn-xs  { padding: 4px 10px; font-size: 11.5px; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }

.form-group label,
.input-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--gray400);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="url"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--gray200);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    color: var(--gray900);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    margin-bottom: 0;
    appearance: auto;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(108,92,231,.12);
}

input[type="range"] {
    accent-color: var(--purple);
    cursor: pointer;
    padding: 0;
    border: none;
    box-shadow: none;
    background: none;
}

input[type="file"] { padding: 7px 10px; }

/* ── ALERTS ── */
.alert {
    padding: 11px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid;
}

/* ── PROGRESS BAR ── */
.prog-track {
    background: var(--gray100);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    flex: 1;
}

.prog-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--purple-mid));
    border-radius: 20px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ── TASK CARDS ── */
.task-card {
    border: 1.5px solid var(--gray200);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.task-card.active { border-color: var(--purple-mid); background: #FEFCFF; }
.task-card.done   { border-color: #9fe6d5; background: #FAFFFD; }
.task-card.locked { opacity: .5; }

/* ── INTERN ROWS ── */
.intern-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--gray100);
}

.intern-row:last-child { border-bottom: none; }

/* ── AVATAR ── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--purple-light);
    color: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar.green  { background: var(--green-light);  color: #007a63; }
.avatar.amber  { background: var(--amber-light);  color: #956c00; }
.avatar.blue   { background: var(--blue-light);   color: var(--blue); }
.avatar.red    { background: var(--red-light);    color: #c0410e; }
.avatar.lg     { width: 48px; height: 48px; font-size: 15px; }

/* ── FEEDBACK BOX ── */
.feedback-box {
    background: var(--purple-light);
    border-left: 3px solid var(--purple);
    border-radius: 0 8px 8px 0;
    padding: 11px 14px;
    font-size: 13px;
    color: var(--gray600);
    font-style: italic;
    margin-bottom: 10px;
    line-height: 1.6;
}

/* ── STARS ── */
.stars { display: flex; gap: 3px; align-items: center; }
.star  { font-size: 15px; color: var(--gray200); }
.star.on { color: var(--amber); }

/* ── UPLOAD BOX ── */
.upload-box {
    border: 2px dashed var(--gray200);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    color: var(--gray400);
    font-size: 13.5px;
    transition: all .2s;
    margin-bottom: 12px;
}

.upload-box:hover {
    border-color: var(--purple);
    background: var(--purple-light);
    color: var(--purple);
}

/* ── AUTH ── */
.auth-page {
    min-height: 100vh;
    background: var(--gray50);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--gray200);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 32px rgba(108,92,231,.12);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--gray900);
    margin-bottom: 24px;
}

/* ── DIVIDER ── */
hr, .divider {
    border: none;
    border-top: 1px solid var(--gray100);
    margin: 16px 0;
}

/* ── NOTIFICATIONS ── */
.notif-item {
    display: flex;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray100);
    align-items: flex-start;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--purple);
    flex-shrink: 0;
    margin-top: 5px;
}

.notif-dot.read { background: var(--gray200); }

/* ── RANK BADGE ── */
.rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray100);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rank.gold   { background: var(--amber-light); color: #956c00; }
.rank.silver { background: var(--gray100);     color: var(--gray600); }
.rank.bronze { background: var(--red-light);   color: #c0410e; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    color: var(--gray400);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 8px 10px 12px 0;
    border-bottom: 2px solid var(--gray100);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 10px 11px 0;
    border-bottom: 1px solid var(--gray100);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--gray50); }

/* ── STIPEND ROWS ── */
.stipend-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--gray100);
    font-size: 13.5px;
}

.stipend-row.total {
    font-weight: 700;
    font-size: 15px;
    border-top: 2px solid var(--gray200);
    border-bottom: none;
    margin-top: 4px;
    padding-top: 12px;
}

/* ── TICKET CARD ── */
.ticket-card {
    border: 1px solid var(--gray200);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--gray200); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--purple); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--purple); }
.timeline-dot.gray { background: var(--gray400); box-shadow: 0 0 0 2px var(--gray400); }

/* ── PROFILE GRID ── */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

/* ══════════════════════════
   RESPONSIVE
══════════════════════════ */
@media (max-width: 960px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 20px 20px 40px; }
}

@media (max-width: 680px) {
    .hamburger { display: flex; }

    .sidebar {
        position: fixed;
        left: -260px;
        top: var(--nav-h);
        height: calc(100vh - var(--nav-h));
        z-index: 200;
        transition: left .25s ease;
        box-shadow: 4px 0 24px rgba(26,24,40,.12);
        width: 240px;
    }

    .sidebar.open { left: 0; }

    .layout { flex-direction: column; }
    .main-content { padding: 16px 15px 40px; }

    .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
    .grid-2, .grid-3, .profile-grid { grid-template-columns: 1fr; }

    .metric-val { font-size: 24px; }
    .page-title { font-size: 18px; }
    .navbar { padding: 0 15px; }
    .user-name { display: none; }
    .card { padding: 14px 15px; }
    .auth-card { padding: 24px 18px; }
}

@media (max-width: 400px) {
    .grid-4 { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric { padding: 14px 14px 12px; }
    .metric-val { font-size: 22px; }
}
