* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #101828;
    color: #e2e8f0;
}

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

.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.45);
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 28px;
}

input, textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #1f2937;
    color: #f8fafc;
    padding: 14px 16px;
    margin-bottom: 16px;
}

textarea {
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #f8fafc;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

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

.btn-link {
    background: transparent;
    color: #60a5fa;
    padding: 0;
}

.alert {
    border-radius: 16px;
    padding: 14px 18px;
    margin: 18px 0;
}

.alert-success {
    background: #0f766e;
}

.alert-error {
    background: #991b1b;
}

.page-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 32px;
}

.topbar p {
    margin: 4px 0 0;
    color: #94a3b8;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1.4fr 1.6fr;
}

.panel {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    padding: 24px;
}

.panel-large {
    grid-column: span 2;
}

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

.panel-header h2 {
    margin: 0;
    font-size: 22px;
}

.card-list {
    display: grid;
    gap: 18px;
}

.card {
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    padding: 18px;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.card-title h3 {
    margin: 0 0 4px;
}

.meta {
    color: #94a3b8;
    font-size: 14px;
}

.badge {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.badge-success {background: #166534;}
.badge-muted {background: #334155;}

.card-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.field-label {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 4px;
}

.card-meta {
    display: flex;
    gap: 16px;
    color: #94a3b8;
    font-size: 14px;
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.inline-form {
    display: inline;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.table th {
    color: #cbd5e1;
    font-weight: 700;
}

.actions-cell {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-empty {
    color: #cbd5e1;
    padding: 32px;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 20px;
}

.note-form {
    display: grid;
    gap: 14px;
    margin-bottom: 20px;
}

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

.note-card {
    padding: 18px;
    border-radius: 20px;
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.note-content {
    color: #cbd5e1;
    white-space: pre-wrap;
}

.note-footer {
    margin-top: 14px;
    font-size: 13px;
    color: #94a3b8;
}

.split-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.split-fields small {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

.modal.open {
    display: flex;
}

.modal-panel {
    width: 100%;
    max-width: 520px;
    background: #0f172a;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

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

.close-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.progress-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    overflow: hidden;
    margin: 14px 0;
}

.progress-filled {
    height: 100%;
    width: 0;
    background: #22c55e;
    transition: width 0.3s ease;
}

.restore-status {
    min-height: 24px;
    color: #cbd5e1;
}

@media (max-width: 980px) {
    .page-grid {
        grid-template-columns: 1fr;
    }
    .split-fields {
        grid-template-columns: 1fr;
    }
}
