:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-weak: #dbeafe;
    --success: #059669;
    --danger: #dc2626;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button {
    border: 0;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}
input, select {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 0;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand span, .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}
.brand strong { font-size: 17px; }
nav { display: grid; gap: 6px; }
nav a {
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 650;
}
nav a:hover, nav a.active { background: var(--primary-weak); color: var(--primary); }
.storage-box { margin-top: auto; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.storage-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 9px; }
.progress { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
small { color: var(--muted); }

.main { margin-left: 260px; padding: 28px; }
.topbar, .toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
.toolbar p { margin: 5px 0 0; color: var(--muted); }
.inline-form, .upload-form { display: flex; gap: 10px; align-items: center; }
.file-picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}
.file-picker input { display: none; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 700; }
.alert.success { background: #dcfce7; color: var(--success); }
.alert.error { background: #fee2e2; color: var(--danger); }

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.folder-card, .file-card, .panel, .login-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.folder-card {
    min-height: 148px;
    padding: 18px;
    display: grid;
    align-content: space-between;
}
.folder-card:hover, .file-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.folder-icon {
    width: 54px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fef3c7;
    color: #b45309;
    font-size: 12px;
    font-weight: 900;
}
.file-card {
    min-height: 148px;
    padding: 16px;
    display: grid;
    gap: 12px;
    transition: .18s ease;
}
.file-type {
    width: 58px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--file-color) 14%, white);
    color: var(--file-color);
    font-size: 12px;
    font-weight: 900;
}
.file-copy strong, .assignment-row strong, .reuse-row strong { display: block; overflow-wrap: anywhere; }
.ghost-btn {
    justify-self: start;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 11px;
    color: var(--primary);
    font-weight: 750;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.panel { padding: 18px; }
.panel-head { margin-bottom: 15px; }
.panel-head p { color: var(--muted); margin: 5px 0 0; }
.stack { display: grid; gap: 10px; }
.assignment-row, .reuse-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}
.reuse-row { grid-template-columns: minmax(0, 1fr) 130px 142px auto; }

.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(430px, 100%); }
.login-panel { padding: 32px; }
.login-panel h1 { margin-top: 18px; }
.login-panel p { color: var(--muted); margin-bottom: 24px; }
.login-panel form { display: grid; gap: 11px; }
.login-panel button { margin-top: 6px; }
.muted-link { display: inline-block; color: var(--muted); margin-top: 18px; }

@media (max-width: 900px) {
    .sidebar { position: static; width: auto; min-height: auto; }
    .main { margin-left: 0; padding: 18px; }
    .split { grid-template-columns: 1fr; }
    .topbar, .toolbar { align-items: flex-start; flex-direction: column; }
    .inline-form, .upload-form { width: 100%; }
    .inline-form input, .inline-form button, .file-picker { width: 100%; }
    .reuse-row { grid-template-columns: 1fr; }
}
