:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #d6deea;
    --text: #17324d;
    --muted: #5c7088;
    --primary: #1769aa;
    --primary-dark: #0d4f82;
    --danger-bg: #fff1f1;
    --danger-text: #a12626;
    --shadow: 0 10px 30px rgba(23, 50, 77, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: linear-gradient(180deg, #eef4fb 0%, #f8fbff 100%);
    color: var(--text);
}

body.login-page {
    background:
        linear-gradient(180deg, rgba(245, 250, 255, 0.72) 0%, rgba(237, 245, 255, 0.84) 100%),
        url('login-background.png') center center / cover no-repeat fixed;
}

body.dashboard-page {
    background:
        linear-gradient(180deg, rgba(246, 250, 255, 0.78) 0%, rgba(235, 244, 255, 0.88) 100%),
        url('login-background.png') center center / cover no-repeat fixed;
}

a {
    color: var(--primary);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.topbar {
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar h1,
.section-head h2,
.card h2,
.login-card h2 {
    margin: 0 0 6px;
}

.topbar p,
.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px 32px;
}

.card,
.login-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-card {
    max-width: 420px;
    margin: 48px auto;
}

.login-shell {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 24px;
}

.login-card-accent {
    width: 100%;
    max-width: 460px;
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(23, 105, 170, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 255, 0.92) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-intro {
    margin-bottom: 22px;
}

.login-intro p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: #e9f3fb;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: rgba(248, 250, 252, 0.92);
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 14px;
}

.button:hover {
    background: var(--primary-dark);
}

.button-light {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.detail-item,
.attachment-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: rgba(248, 250, 252, 0.84);
}

.detail-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    word-break: break-word;
}

.detail-value {
    word-break: break-word;
}

.detail-box {
    white-space: pre-wrap;
    background: rgba(248, 250, 252, 0.84);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.attachment-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.preview-image {
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    background: rgba(248, 250, 252, 0.7);
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--danger-bg);
    color: var(--danger-text);
    margin-bottom: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #77abd8;
    box-shadow: 0 0 0 4px rgba(23, 105, 170, 0.12);
}

.login-submit {
    width: 100%;
    margin-top: 6px;
    padding-top: 12px;
    padding-bottom: 12px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .topbar,
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .container {
        margin-top: 16px;
    }

    .card,
    .login-card {
        padding: 16px;
    }

    .login-shell {
        min-height: auto;
        padding-top: 0;
    }
}
