:root {
    --bg-ink: #04070f;
    --bg-navy: #091428;
    --panel: #0f1b33;
    --panel-soft: #162643;
    --line: #263757;
    --text-main: #e8f0ff;
    --text-muted: #9eb2d8;
    --brand: #1f6feb;
    --brand-hover: #3b82f6;
    --danger: #ef4444;
    --success: #34d399;
    --shadow-strong: 0 22px 52px rgba(2, 8, 23, 0.55);
}

* , *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    background:
        radial-gradient(1100px 560px at 8% 0%, #173265 0%, rgba(23, 50, 101, 0) 62%),
        radial-gradient(900px 520px at 96% 100%, #0e2445 0%, rgba(14, 36, 69, 0) 58%),
        linear-gradient(165deg, var(--bg-ink) 0%, var(--bg-navy) 100%);
}

a {
    color: #9ec2ff;
}

.top-logo {
    display: flex;
    justify-content: center;
    margin: 24px 0 10px;
}

.top-logo img {
    width: min(220px, 70vw);
    height: auto;
    display: block;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 30px auto;
    background: linear-gradient(180deg, rgba(22, 38, 67, 0.9) 0%, rgba(15, 27, 51, 0.96) 100%);
    border: 1px solid var(--line);
    padding: 22px;
    box-shadow: var(--shadow-strong);
    border-radius: 14px;
    overflow: hidden;
}

h1,
h2,
h3 {
    color: #dbeafe;
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 12px;
    border: 1px solid var(--line);
    text-align: left;
}

th {
    background: #152946;
    color: #dbeafe;
}

.btn {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid rgba(150, 193, 255, 0.2);
    background: linear-gradient(180deg, #2f7ef6 0%, #1f6feb 100%);
    color: #f8fbff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.btn:hover {
    background: linear-gradient(180deg, #4f96ff 0%, #327df2 100%);
    transform: translateY(-1px);
}

.btn-danger {
    color: #fecaca;
    text-decoration: none;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: stretch;
}

.card {
    background: linear-gradient(180deg, rgba(20, 39, 71, 0.95) 0%, rgba(14, 27, 52, 0.95) 100%);
    border: 1px solid var(--line);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(2, 8, 23, 0.42);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card h3 {
    margin: 0 0 10px;
    line-height: 1.25;
    min-height: 3.75em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card p {
    margin: 0 0 14px;
    color: var(--text-muted);
}

.card-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.card .btn {
    margin-top: auto;
    align-self: flex-start;
}

.btn-download-icon {
    width: 36px;
    height: 36px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #1d4fd815;
    color: #ffffff10;
    border: 0.5px solid rgba(147, 196, 253, 0.068);
    flex: 0 0 36px;
}

.btn-download-icon:hover {
    background: #e0e6e9d7;
}

.btn-download-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-download-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.pagination {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.pagination span {
    color: var(--text-muted);
    font-weight: 600;
}

.msg {
    color: var(--success);
    font-weight: 600;
}

.admin-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: min(92vw, 420px);
    background: linear-gradient(180deg, rgba(22, 38, 67, 0.96) 0%, rgba(15, 27, 51, 0.98) 100%);
    border: 1px solid var(--line);
    padding: 36px;
    border-radius: 14px;
    box-shadow: var(--shadow-strong);
    text-align: center;
}

.login-card input {
    width: 100%;
    padding: 11px 12px;
    margin: 10px 0;
    border: 1px solid #344a72;
    border-radius: 8px;
    color: #e2e8f0;
    background: #0d1a30;
}

.login-card button {
    width: 100%;
    padding: 11px;
    background: linear-gradient(180deg, #2f7ef6 0%, #1f6feb 100%);
    color: #fff;
    border: 1px solid rgba(150, 193, 255, 0.24);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.login-card button:hover {
    background: linear-gradient(180deg, #4f96ff 0%, #327df2 100%);
}

.error {
    color: #fca5a5;
    font-size: 14px;
}

hr {
    border: none;
    height: 1px;
    background: #2a3d62;
    margin: 18px 0;
}

@media (max-width: 768px) {
    .top-logo {
        margin-top: 16px;
    }

    .container {
        width: calc(100% - 16px);
        margin: 16px auto;
        padding: 14px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}