:root {
    --bg: #0b1020;
    --panel: #121a2f;
    --panel-2: #19233e;
    --text: #e7ecf7;
    --muted: #9ca8c7;
    --border: rgba(255,255,255,0.08);
    --primary: #6ea8fe;
    --primary-2: #8f6dff;
    --success: #3ddc97;
    --danger: #ff7b7b;
    --shadow: 0 20px 50px rgba(0,0,0,0.35);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(110,168,254,0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(143,109,255,0.12), transparent 25%),
        linear-gradient(180deg, #09101d 0%, #0b1020 100%);
    color: var(--text);
    min-height: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    opacity: 0.9;
}

.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 22px;
    background: rgba(18, 26, 47, 0.88);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    margin-bottom: 28px;
}

.brand-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    color: white;
    letter-spacing: 0.4px;
}

.brand-sub {
    font-size: 13px;
    color: var(--muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

.page-wrap {
    background: rgba(18, 26, 47, 0.88);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px;
    backdrop-filter: blur(10px);
}

h1, h2, h3 {
    margin-top: 0;
    color: white;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.18s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    border-color: var(--border);
    color: white;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 18px;
}

.notice {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 600;
}

.notice-success {
    background: rgba(61,220,151,0.12);
    border: 1px solid rgba(61,220,151,0.3);
    color: #b8f5da;
}

.notice-error {
    background: rgba(255,123,123,0.12);
    border: 1px solid rgba(255,123,123,0.28);
    color: #ffd0d0;
}

.form-grid {
    display: grid;
    gap: 16px;
    max-width: 780px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: white;
}

.input, .textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: white;
    padding: 12px 14px;
    font-size: 15px;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.textarea {
    min-height: 420px;
    resize: vertical;
    font-family: Consolas, monospace;
    line-height: 1.45;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: white;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: rgba(61,220,151,0.12);
    color: #b8f5da;
    border: 1px solid rgba(61,220,151,0.3);
}

.badge-muted {
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    border: 1px solid var(--border);
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.path-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    margin-bottom: 16px;
}

.file-list {
    display: grid;
    gap: 12px;
}

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 14px 16px;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    color: white;
    font-weight: 700;
}

.file-sub {
    color: var(--muted);
    font-size: 13px;
}

.file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Hide public Register links from default Identity UI */
a[href*="/Identity/Account/Register"] {
    display: none !important;
}

.login-container
{
    display:flex;
    justify-content:center;
    align-items:center;
    height:70vh;
}

.login-card
{
    width:420px;
    padding:40px;
    border-radius:12px;
    background:#1e1e1e;
    box-shadow:0 0 15px rgba(0,0,0,.4);
}

.login-card h1
{
    text-align:center;
    margin-bottom:25px;
}

.big-input
{
    height:55px;
    font-size:18px;
}

.login-button
{
    width:100%;
    height:50px;
    margin-top:20px;
    font-size:18px;
}

/* ===== Global spacing + layout polish ===== */

.page-wrap > h1,
.page-wrap > h2,
.page-wrap > h3,
.page-wrap > p:first-of-type {
    margin-top: 0;
}

.page-wrap > p {
    margin-bottom: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 22px;
    margin-bottom: 24px;
}

.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.card p:last-child {
    margin-bottom: 0;
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 18px;
    margin-bottom: 22px;
}

.form-grid {
    display: grid;
    gap: 18px;
    max-width: 820px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin: 0;
}

.input,
.textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: white;
    padding: 12px 14px;
    font-size: 15px;
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.textarea {
    min-height: 420px;
    resize: vertical;
    font-family: Consolas, monospace;
    line-height: 1.45;
}

.notice {
    padding: 14px 16px;
    border-radius: 14px;
    margin-top: 14px;
    margin-bottom: 22px;
    font-weight: 600;
}

.path-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    margin-top: 14px;
    margin-bottom: 18px;
}

.file-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 16px 18px;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    flex: 1;
}

.file-name {
    color: white;
    font-weight: 700;
    line-height: 1.3;
}

.file-sub {
    color: var(--muted);
    font-size: 13px;
}

.file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.file-actions form {
    margin: 0;
}

.file-actions .input {
    width: 150px;
    min-height: 42px;
    margin: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: white;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Better spacing for stacked page sections */
.section-block {
    margin-bottom: 26px;
}

.section-block:last-child {
    margin-bottom: 0;
}

.auth-shell {
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 540px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px;
    box-shadow: var(--shadow);
}

.auth-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-header h1 {
    margin: 0 0 8px 0;
    font-size: 36px;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form .form-group {
    display: grid;
    gap: 8px;
    margin: 0;
}

.auth-form .input {
    width: 100%;
}

.input-lg {
    font-size: 18px;
    padding: 16px 18px;
    min-height: 58px;
}

.checkbox-row {
    margin-top: 2px;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}

.auth-actions {
    margin-top: 4px;
}

.btn-block {
    width: 100%;
    min-height: 54px;
    font-size: 17px;
}

.text-danger {
    color: #ffb3b3;
    font-size: 14px;
}