:root {
    --navy: #0B1228;
    --navy-2: #151B3A;
    --purple: #7C3AED;
    --purple-dark: #6D28D9;
    --teal: #14B8A6;
    --teal-dark: #0D9488;
    --orange: #F97316;
    --surface: #FFFFFF;
    --surface-soft: #F8FAFC;
    --surface-tint: #EEF2FF;
    --text: #0F172A;
    --muted: #475569;
    --border: #C7D2FE;
    --danger: #DC2626;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(11, 18, 40, 0.12);
    --font: "Segoe UI", "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
        radial-gradient(900px 400px at 100% 0%, rgba(20, 184, 166, 0.14), transparent 55%),
        linear-gradient(160deg, #F5F3FF 0%, #F0FDFA 45%, #EEF2FF 100%);
}

a { color: var(--purple); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 22px;
    background: linear-gradient(90deg, #0B1228 0%, #1A1240 55%, #2A1460 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(11, 18, 40, 0.28);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
}

.brand-text strong {
    display: block;
    font-size: 15px;
    letter-spacing: 0.01em;
}

.brand-text span {
    display: block;
    font-size: 12px;
    color: #C4B5FD;
    margin-top: 2px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.topbar a {
    color: #E0E7FF;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.topbar a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.page-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.page-hero h1 {
    margin: 0;
    font-size: 30px;
    color: #1E1B4B;
}

.page-hero p {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 640px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card h2,
.card h3 {
    margin-top: 0;
    color: #1E1B4B;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--purple);
    margin: 8px 0;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

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

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.case-card {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.case-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(11, 18, 40, 0.16);
}

.case-card-media {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #EDE9FE, #CCFBF1);
}

.case-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.case-card-media .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(11, 18, 40, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
}

.case-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.case-card-body h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

.case-card-body p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.thumbs {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.thumbs img {
    width: 36px;
    height: 28px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #312E81;
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid #CBD5E1;
    border-radius: 12px;
    margin-bottom: 14px;
    font: inherit;
    background: var(--surface-soft);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

textarea { min-height: 110px; resize: vertical; }

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: linear-gradient(135deg, var(--purple), #5B21B6);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.25);
    transition: transform 0.12s ease, filter 0.12s ease;
}

button:hover,
.btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #475569, #334155);
    box-shadow: 0 8px 18px rgba(51, 65, 85, 0.22);
}

.btn-teal {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    box-shadow: 0 8px 18px rgba(13, 148, 136, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, var(--danger));
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    vertical-align: top;
    border-bottom: 1px solid #E2E8F0;
}

th {
    background: #F5F3FF;
    color: #312E81;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:hover td { background: #FAFAFF; }

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
}

.flash.success {
    background: #CCFBF1;
    color: #115E59;
    border: 1px solid #99F6E4;
}

.flash.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.gallery img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(11, 18, 40, 0.08);
}

.login-shell {
    min-height: calc(100vh - 90px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(440px, 100%);
}

.site-footer {
    margin-top: 28px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.site-footer img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 720px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .nav { justify-content: flex-start; }
    .brand-text strong { font-size: 14px; }
}
