* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f5f7fb;
    color: #172033;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, 92%);
    margin: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #e7eaf1;
}

.navbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d4ed8;
    font-size: 22px;
    font-weight: 850;
}

.logo-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: white;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 12px 30px rgba(37,99,235,.25);
}

.nav-menu {
    display: flex;
    gap: 26px;
    color: #4b587c;
    font-size: 15px;
    font-weight: 700;
}

.nav-actions,
.hero-actions,
.doc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 12px 28px rgba(37,99,235,.25);
}

.btn-light {
    color: #1d4ed8;
    background: #eef4ff;
}

.btn-muted {
    color: #475569;
    background: #f1f5f9;
}

.btn-danger {
    color: #fff;
    background: #dc2626;
}

.full-width {
    width: 100%;
}

.hero {
    padding: 76px 0 46px;
    background:
        radial-gradient(circle at 20% 10%, rgba(37,99,235,.16), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(124,58,237,.15), transparent 30%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 42px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 18px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eaf1ff;
    font-size: 14px;
    font-weight: 800;
}

h1 {
    margin-bottom: 20px;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.08;
    letter-spacing: -1.8px;
}

.hero p {
    max-width: 620px;
    margin-bottom: 26px;
    color: #5f6b86;
    font-size: 18px;
}

.hero-card,
.form-page-card,
.auth-card {
    background: rgba(255,255,255,.82);
    border: 1px solid #e5eaf5;
    border-radius: 28px;
    padding: 26px;
    box-shadow: 0 24px 70px rgba(30,41,59,.12);
}

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

.stat {
    padding: 18px;
    border: 1px solid #e8edf5;
    border-radius: 20px;
    background: white;
}

.stat strong {
    display: block;
    color: #1d4ed8;
    font-size: 26px;
}

.stat span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.permission-note,
.info-box {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

.section-title {
    margin: 52px 0 20px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.section-title h2 {
    font-size: 32px;
    letter-spacing: -.8px;
}

.section-title p {
    color: #64748b;
}

.status-box {
    background: white;
    border: 1px solid #e7ebf4;
    border-radius: 18px;
    padding: 13px 16px;
    color: #64748b;
}

.status-box strong {
    color: #1d4ed8;
}

.toolbar {
    margin: 32px 0;
    padding: 18px;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, .8fr) auto;
    gap: 12px;
    background: white;
    border: 1px solid #e7ebf4;
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(15,23,42,.06);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #dbe2ee;
    border-radius: 14px;
    padding: 13px 14px;
    outline: none;
    background: white;
    font-size: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: #334155;
    font-weight: 800;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}

.category-block {
    margin-bottom: 34px;
}

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

.category-header h3 {
    font-size: 22px;
}

.count-pill {
    padding: 5px 11px;
    border-radius: 999px;
    background: #eaf1ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 850;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.doc-card {
    min-width: 0;
    padding: 20px;
    background: white;
    border: 1px solid #e7ebf4;
    border-radius: 24px;
    box-shadow: 0 14px 35px rgba(15,23,42,.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.doc-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.file-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: white;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    font-weight: 900;
    font-size: 13px;
}

.doc-card h4 {
    font-size: 17px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.doc-card p {
    color: #64748b;
    font-size: 14px;
}

.meta {
    display: grid;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid #eef2f7;
    color: #64748b;
    font-size: 13px;
}

.doc-actions {
    margin-top: auto;
}

.doc-actions .btn,
.doc-actions form {
    flex: 1;
}

.doc-actions form button {
    width: 100%;
}

.empty-state {
    padding: 28px;
    border: 1px dashed #cbd5e1;
    border-radius: 22px;
    background: white;
    color: #64748b;
    text-align: center;
}

.toast,
.alert {
    width: min(900px, 92%);
    margin: 18px auto;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 750;
}

.toast-success,
.alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.toast-error,
.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.page-section {
    padding: 44px 0;
}

.form-page-card {
    width: min(720px, 100%);
    margin: auto;
}

.form-page-card h1,
.auth-card h1 {
    margin-bottom: 8px;
    font-size: 34px;
}

.form-page-card p,
.auth-card p {
    margin-bottom: 22px;
    color: #64748b;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(37,99,235,.15), transparent 26%),
        radial-gradient(circle at 80% 12%, rgba(124,58,237,.14), transparent 28%),
        #f5f7fb;
}

.auth-card {
    width: min(460px, 100%);
}

.auth-logo {
    margin-bottom: 24px;
}

footer {
    margin-top: 64px;
    padding: 42px 0;
    background: #0f172a;
    color: #cbd5e1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 26px;
}

footer h4 {
    margin-bottom: 12px;
    color: white;
}

footer p,
footer li {
    list-style: none;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 14px;
}

@media (max-width: 960px) {
    .nav-menu {
        display: none;
    }

    .hero-grid,
    .document-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 16px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-actions,
    .nav-actions .btn,
    .hero-actions .btn {
        width: 100%;
    }

    .toolbar,
    .stats {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .doc-actions {
        flex-direction: column;
    }
}
