@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
    --ink:        #1a1a1a;
    --ink-mid:    #555;
    --ink-light:  #999;
    --paper:      #fafaf8;
    --surface:    #ffffff;
    --border:     #e8e6e0;
    --accent:     #2c5282;
    --accent-lt:  #ebf0f8;
    --danger:     #c0392b;
    --success:    #1a6b3c;
    --warning:    #b7791f;
    --pending:    #64748b;
    --radius:     6px;
    --shadow:     0 1px 4px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.04);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── LOGIN ── */
.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}
.login-brand {
    background: var(--ink);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px;
    color: #fff;
}
.login-brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.login-brand p { color: rgba(255,255,255,0.5); font-size: 13px; margin-top: 12px; }
.login-brand .tagline { font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 0.15em; text-transform: uppercase; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 400; margin-bottom: 8px; }
.login-form .sub { color: var(--ink-light); font-size: 13px; margin-bottom: 36px; }

/* ── NAV ── */
.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.nav-brand span { color: var(--ink-light); font-size: 13px; font-family: 'DM Sans', sans-serif; margin-left: 10px; font-weight: 300; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-mid); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--ink); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 500; letter-spacing: 0.05em;
}
.nav-link { font-size: 13px; color: var(--ink-mid); text-decoration: none; }
.nav-link:hover { color: var(--ink); }

/* ── LAYOUT ── */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 28px 0;
}
.sidebar-section { padding: 0 20px; margin-bottom: 8px; }
.sidebar-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-light); font-weight: 500; margin-bottom: 8px; padding: 0 8px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius);
    font-size: 13px; color: var(--ink-mid); text-decoration: none;
    transition: all 0.15s;
}
.sidebar-link:hover { background: var(--paper); color: var(--ink); }
.sidebar-link.active { background: var(--accent-lt); color: var(--accent); font-weight: 500; }
.sidebar-link svg { width: 15px; height: 15px; opacity: 0.7; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 16px 20px; }
.main { padding: 36px 40px; max-width: 1100px; }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 400; margin-bottom: 4px; }
.page-header p { color: var(--ink-light); font-size: 13px; }
.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; }

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 500; color: var(--ink); }

/* ── STAT CARDS ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-light); margin-bottom: 8px; }
.stat-card .value { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 400; color: var(--ink); line-height: 1; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-mid); margin-bottom: 6px; letter-spacing: 0.03em; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
select, textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif; font-size: 14px;
    color: var(--ink); background: var(--surface);
    transition: border-color 0.15s;
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--ink-light); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px; border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
    cursor: pointer; border: 1px solid transparent;
    text-decoration: none; transition: all 0.15s;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #333; }
.btn-secondary { background: transparent; color: var(--ink-mid); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--ink-mid); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: #fcc; }
.btn-danger:hover { background: #ffeaea; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-light); font-weight: 500; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--ink-mid); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--paper); }
td a { color: var(--ink); text-decoration: none; font-weight: 500; }
td a:hover { color: var(--accent); }

/* ── BADGES ── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 500; letter-spacing: 0.03em;
}
.badge-pending    { background: #f1f5f9; color: var(--pending); }
.badge-in_progress{ background: #eff6ff; color: #1d4ed8; }
.badge-review     { background: #fefce8; color: #92400e; }
.badge-completed  { background: #f0fdf4; color: var(--success); }
.badge-active     { background: #f0fdf4; color: var(--success); }
.badge-on_hold    { background: #fefce8; color: var(--warning); }
.badge-high       { background: #fef2f2; color: var(--danger); }
.badge-medium     { background: #fffbeb; color: var(--warning); }
.badge-low        { background: #f8fafc; color: var(--ink-light); }

/* ── TASK LIST ── */
.task-item {
    display: grid; grid-template-columns: 24px 1fr auto auto;
    gap: 14px; align-items: center;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check { width: 18px; height: 18px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.task-check.done { background: var(--success); border-color: var(--success); }
.task-title { font-size: 14px; color: var(--ink); font-weight: 400; }
.task-title.done { text-decoration: line-through; color: var(--ink-light); }
.task-meta { font-size: 12px; color: var(--ink-light); margin-top: 2px; }

/* ── COMMENTS ── */
.comment { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-author { font-size: 13px; font-weight: 500; color: var(--ink); }
.comment-time { font-size: 11px; color: var(--ink-light); margin-left: 8px; }
.comment-text { font-size: 14px; color: var(--ink-mid); margin-top: 4px; line-height: 1.6; }

/* ── FILES ── */
.file-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.file-item:last-child { border-bottom: none; }
.file-icon { width: 36px; height: 36px; background: var(--paper); border: 1px solid var(--border); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink-light); letter-spacing: 0; }
.file-name { font-size: 14px; color: var(--ink); font-weight: 400; }
.file-size { font-size: 12px; color: var(--ink-light); }
.file-actions { margin-left: auto; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ── EMPTY STATES ── */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-light); }
.empty h3 { font-size: 16px; font-weight: 400; margin-bottom: 8px; color: var(--ink-mid); }
.empty p { font-size: 13px; }

/* ── UPLOAD ZONE ── */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 32px; text-align: center; cursor: pointer;
    transition: all 0.2s; color: var(--ink-light); font-size: 13px;
}
.upload-zone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }

/* ── MODAL ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); transform: translateY(10px); transition: transform 0.2s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-light); }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── PROGRESS BAR ── */
.progress-wrap { margin: 8px 0; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }
.progress-label { font-size: 11px; color: var(--ink-light); margin-top: 4px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main { padding: 20px; }
    .stats { grid-template-columns: 1fr 1fr; }
}
