/* =====================================================
   Sistem Manajemen Tugas Mahasiswa — Global Styles
   Design: Academic Precision | Pure CSS, No Framework
   ===================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Colors */
    --primary:            #2563eb;
    --primary-dark:       #1d4ed8;
    --primary-light:      #dbeafe;
    --deep-navy:          #00081C;
    --academic-teal:      #00A4A6;
    --teal-light:         #ccf2f2;
    --secondary:          #64748b;
    --secondary-light:    #f1f5f9;
    --error:              #dc2626;
    --error-light:        #fee2e2;
    --success:            #16a34a;
    --success-light:      #dcfce7;
    --warning:            #d97706;
    --warning-light:      #fef3c7;

    /* Surface */
    --bg:                 #f8fafc;
    --surface:            #ffffff;
    --surface-dim:        #f1f5f9;
    --border:             #e2e8f0;
    --border-focus:       #2563eb;

    /* Text */
    --text-primary:       #0f172a;
    --text-secondary:     #64748b;
    --text-muted:         #94a3b8;
    --text-white:         #ffffff;

    /* Sidebar */
    --sidebar-width:      260px;
    --sidebar-collapsed:  72px;

    /* Spacing */
    --radius-sm:          4px;
    --radius:             6px;
    --radius-lg:          10px;
    --radius-xl:          14px;
    --radius-full:        9999px;
    --shadow-sm:          0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:             0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg:          0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
}

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

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* --- Layout Shell --- */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--deep-navy);
    color: #c8d3e8;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0;
    height: 100%;
    z-index: 40;
    transition: transform 0.25s ease, width 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.brand-title { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: #4a5568;
    padding: 0 8px; margin-bottom: 6px;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-lg);
    color: #94a3b8;
    font-size: 14px; font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer; border: none; background: none; width: 100%;
    text-decoration: none;
    border-left: 3px solid transparent;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    text-decoration: none;
}

.nav-item.active {
    background: rgba(37,99,235,0.18);
    color: #93c5fd;
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

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

/* === TOPBAR === */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 0 24px;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
    flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.mobile-menu-btn {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 6px;
    border-radius: var(--radius);
}

.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 7px 14px;
    width: 300px; transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
    border: none; background: none; outline: none;
    font-size: 13px; color: var(--text-primary); width: 100%;
}
.search-box .material-symbols-outlined { font-size: 18px; color: var(--text-muted); }

.topbar-icon-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); padding: 7px;
    border-radius: var(--radius-full); transition: background 0.15s;
    display: flex; align-items: center;
}
.topbar-icon-btn:hover { background: var(--surface-dim); }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid var(--border);
}

/* === PAGE CONTENT === */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px 40px;
    background: var(--bg);
}

.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* === STATS CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.stat-card-icon .material-symbols-outlined { font-size: 22px; }

.stat-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.stat-card-bg-icon {
    position: absolute; right: -10px; top: -10px;
    font-size: 90px; opacity: 0.06;
    transition: transform 0.3s ease;
}
.stat-card:hover .stat-card-bg-icon { transform: scale(1.1) rotate(-5deg); }

/* Stat card variants */
.stat-blue   { border-top: 3px solid var(--primary); }
.stat-blue   .stat-card-icon { background: var(--primary-light); color: var(--primary); }
.stat-blue   .stat-label     { color: var(--primary); }
.stat-blue   .stat-card-bg-icon { color: var(--primary); }

.stat-gray   { border-top: 3px solid var(--secondary); }
.stat-gray   .stat-card-icon { background: #f1f5f9; color: var(--secondary); }
.stat-gray   .stat-label     { color: var(--secondary); }
.stat-gray   .stat-card-bg-icon { color: var(--secondary); }

.stat-teal   { border-top: 3px solid var(--academic-teal); }
.stat-teal   .stat-card-icon { background: var(--teal-light); color: var(--academic-teal); }
.stat-teal   .stat-label     { color: var(--academic-teal); }
.stat-teal   .stat-card-bg-icon { color: var(--academic-teal); }

.stat-red    { border-top: 3px solid var(--error); }
.stat-red    .stat-card-icon { background: var(--error-light); color: var(--error); }
.stat-red    .stat-label     { color: var(--error); }
.stat-red    .stat-card-bg-icon { color: var(--error); }

.progress-bar-track {
    height: 5px; background: var(--surface-dim);
    border-radius: var(--radius-full); overflow: hidden; margin-top: 12px;
}
.progress-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.6s ease; }

/* === CARDS === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body  { padding: 20px; }

/* === TABLES === */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%; border-collapse: collapse;
    font-size: 14px;
}
thead th {
    background: var(--bg);
    padding: 11px 16px;
    text-align: left;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* === BADGES / STATUS === */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--error-light);   color: var(--error);   }
.badge-warning { background: var(--warning-light);  color: var(--warning); }
.badge-primary { background: var(--primary-light);  color: var(--primary); }
.badge-secondary{ background: var(--surface-dim);    color: var(--secondary); }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-lg);
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; outline: none;
    transition: all 0.15s ease; text-decoration: none;
    white-space: nowrap; line-height: 1.5;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .material-symbols-outlined { font-size: 17px; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }

.btn-danger    { background: var(--error); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-secondary { background: var(--surface-dim); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

.btn-ghost     { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }

.btn-icon      { padding: 7px; border-radius: var(--radius-lg); }

.btn-sm        { padding: 5px 11px; font-size: 12px; }
.btn-lg        { padding: 11px 22px; font-size: 15px; }
.btn-block     { width: 100%; justify-content: center; }

/* === FORMS === */
.form-group   { margin-bottom: 18px; }
.form-label   {
    display: block; font-size: 12px; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-label .required { color: var(--error); margin-left: 2px; }

.form-control {
    display: block; width: 100%;
    padding: 9px 13px;
    font-size: 14px; font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.is-invalid { border-color: var(--error); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.1); }

textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.form-error { font-size: 12px; color: var(--error); margin-top: 4px; }
.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Form row grid */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions {
    display: flex; gap: 10px; align-items: center;
    padding-top: 8px; margin-top: 4px;
}

/* === ALERTS === */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-lg);
    font-size: 14px; margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert .material-symbols-outlined { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: var(--success); border-color: #a7f3d0; }
.alert-danger  { background: var(--error-light);   color: var(--error);   border-color: #fecaca; }
.alert-warning { background: var(--warning-light);  color: var(--warning); border-color: #fde68a; }
.alert-info    { background: var(--primary-light);  color: var(--primary); border-color: #bfdbfe; }

/* === TOOLBAR (search + filter row) === */
.toolbar {
    display: flex; gap: 10px; align-items: center;
    flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 7px 12px;
    flex: 1; min-width: 200px;
}
.toolbar-search input { border: none; outline: none; font-size: 14px; background: none; width: 100%; }
.toolbar-search .material-symbols-outlined { color: var(--text-muted); font-size: 18px; }
.toolbar select {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-lg); font-size: 13px;
    background: var(--surface); color: var(--text-primary);
    cursor: pointer; outline: none;
}

/* === DETAIL PAGE === */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.detail-item { margin-bottom: 14px; }
.detail-item-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.detail-item-value { font-size: 14px; color: var(--text-primary); }

/* === DEADLINE COUNTDOWN === */
.deadline-urgent  { color: var(--error); font-weight: 600; }
.deadline-soon    { color: var(--warning); font-weight: 600; }
.deadline-ok      { color: var(--success); }
.deadline-overdue { color: var(--error); font-weight: 600; }

/* === LOGIN PAGE === */
.login-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #00081C 0%, #0f2460 60%, #1e3a8a 100%);
    padding: 20px;
}
.login-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    padding: 40px 44px;
    width: 100%; max-width: 420px;
}
.login-logo {
    width: 52px; height: 52px;
    background: var(--primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(37,99,235,0.4);
}
.login-logo .material-symbols-outlined { font-size: 28px; color: #fff; }
.login-title { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

/* === PROFILE / ABOUT === */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.team-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 22px;
    text-align: center; box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}
.team-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.team-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    font-size: 22px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
}
.team-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.team-nim  { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.team-role { font-size: 12px; background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: var(--radius-full); display: inline-block; font-weight: 600; }

.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tech-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 18px;
    text-align: center; box-shadow: var(--shadow-sm);
}
.tech-icon { font-size: 32px; margin-bottom: 8px; }
.tech-name { font-size: 14px; font-weight: 600; }
.tech-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* === EMPTY STATE === */
.empty-state {
    padding: 60px 20px; text-align: center;
}
.empty-state .material-symbols-outlined { font-size: 56px; color: var(--text-muted); margin-bottom: 12px; }
.empty-state-title { font-size: 17px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* === MODAL === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
    background: var(--surface); border-radius: 16px;
    padding: 28px; max-width: 440px; width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.modal-body  { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    .search-box { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row  { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-search { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 28px 22px; }
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 39;
}
.sidebar-overlay.active { display: block; }

/* Utility */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
