:root {
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --header-border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 24px rgba(15, 23, 42, 0.08);
    --radius: 10px;
    --radius-lg: 14px;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --success-border: #a7f3d0;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --error-border: #fecaca;
}

* {
    box-sizing: border-box;
}

.admin-body {
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ——— Header alb, full width ——— */
.top-nav {
    background: #ffffff;
    color: var(--text);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.brand-logo {
    width: 82px !important;
    height: 82px !important;
    min-width: 82px;
    min-height: 82px;
    max-width: 82px;
    max-height: 82px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.main-nav a.nav-logout {
    color: #94a3b8;
}

.main-nav a.nav-logout:hover {
    color: #dc2626;
    background: #fef2f2;
}

.user-pill {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    flex-shrink: 0;
}

.user-pill-label {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* ——— Conținut principal ——— */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.main-content > h2:first-child,
.main-content > h1:first-child {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 20px;
}

/* ——— Formulare & carduri ——— */
form {
    display: grid;
    gap: 14px;
    max-width: 720px;
    margin-bottom: 20px;
}

label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    font-family: inherit;
    font-size: 0.9375rem;
    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(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button {
    border: 0;
    border-radius: var(--radius);
    padding: 11px 18px;
    cursor: pointer;
    color: #fff;
    background: var(--accent);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background 0.15s ease, transform 0.05s ease;
}

button:hover {
    background: var(--accent-hover);
}

button:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #64748b;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

/* ——— Tabele ——— */
.courts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.courts-table th,
.courts-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

.courts-table tr:last-child td {
    border-bottom: 0;
}

.courts-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.courts-table tbody tr:hover td {
    background: #fafbfc;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.inline-form {
    display: inline-block;
    margin-left: 0;
}

/* ——— Flash & erori ——— */
.flash-message {
    margin: 0 0 20px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.flash-error,
.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

/* ——— Footer ——— */
.site-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--border);
}

.site-footer p {
    margin: 0;
}

/* ——— Login LexDocs (pagină standalone) ——— */
body.login-page-lex {
    height: 100%;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: #f7f5f1;
}

body.login-page-lex .lex-page {
    display: flex;
    min-height: 100vh;
}

body.login-page-lex .lex-left {
    width: 42%;
    background: #0d1b2a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px 48px;
    position: relative;
    overflow: hidden;
}

body.login-page-lex .lex-deco-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.045;
}

body.login-page-lex .lex-left-top {
    position: relative;
    z-index: 2;
}

body.login-page-lex .lex-left-bottom {
    position: relative;
    z-index: 2;
}

body.login-page-lex .lex-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 72px;
}

body.login-page-lex .lex-logo-box {
    width: 82px;
    height: 82px;
    border: 1.5px solid #c9a84c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.login-page-lex .lex-left-logo-img {
    max-height: 190px;
    width: auto;
    max-width: 460px;
    object-fit: contain;
    display: block;
}

body.login-page-lex .lex-left-title {
    font-size: 30px;
    color: #f5f0e8;
    font-weight: 400;
    line-height: 1.45;
    margin: 0 0 20px;
    letter-spacing: 0.2px;
}

body.login-page-lex .lex-left-title-sub {
    display: block;
    margin-top: 8px;
    font-size: 22px;
    color: #c9a84c;
    font-weight: 400;
    letter-spacing: 0.5px;
}

body.login-page-lex .lex-left-lead {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(245, 240, 232, 0.82);
    font-weight: 400;
    max-width: 340px;
}

body.login-page-lex .lex-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #f7f5f1;
}

body.login-page-lex .lex-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border: 0.5px solid #ddd9d1;
    border-radius: 3px;
    padding: 48px 44px;
}

body.login-page-lex .lex-card-title {
    font-size: 24px;
    color: #0d1b2a;
    font-weight: 400;
    margin: 0 0 6px;
    letter-spacing: 0.2px;
}

body.login-page-lex .lex-card-sub {
    font-size: 13px;
    color: #7a7a6e;
    margin: 0 0 40px;
    line-height: 1.6;
    font-family: Arial, Helvetica, sans-serif;
}

body.login-page-lex .lex-alert-error {
    margin: 0 0 24px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
    background: #fef2f2;
    border: 0.5px solid #fecaca;
    border-radius: 2px;
    font-family: Arial, Helvetica, sans-serif;
}

body.login-page-lex .lex-field {
    margin-bottom: 22px;
}

body.login-page-lex .lex-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

body.login-page-lex .lex-field > label {
    font-size: 10px;
    letter-spacing: 2px;
    color: #5a5a50;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

body.login-page-lex .lex-field-header label {
    margin-bottom: 0;
}

body.login-page-lex .lex-forgot {
    font-size: 12px;
    color: #c9a84c;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
}

body.login-page-lex .lex-forgot:hover {
    text-decoration: underline;
}

body.login-page-lex .lex-field input {
    width: 100%;
    height: 44px;
    border: 0.5px solid #c8c4bc;
    border-radius: 2px;
    padding: 0 14px;
    font-size: 14px;
    color: #0d1b2a;
    background: #fdfcfb;
    outline: none;
    font-family: Georgia, "Times New Roman", serif;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

body.login-page-lex .lex-field input:focus {
    border-color: #c9a84c;
    background: #fffdf9;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

body.login-page-lex .lex-field input::placeholder {
    color: #bcbab0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

body.login-page-lex .lex-btn {
    width: 100%;
    height: 46px;
    background: #0d1b2a;
    border: none;
    border-radius: 2px;
    color: #f5f0e8;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-family: Georgia, "Times New Roman", serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    transition: background 0.15s;
}

body.login-page-lex .lex-btn:hover {
    background: #152333;
}

body.login-page-lex .lex-btn:active {
    background: #08111c;
}

body.login-page-lex .lex-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
}

body.login-page-lex .lex-secure span {
    font-size: 11px;
    color: #a0a090;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0.3px;
}

body.login-page-lex .lex-dev-line {
    text-align: center;
    font-size: 11px;
    color: #bcbab0;
    font-family: Arial, Helvetica, sans-serif;
    margin: 14px 0 0;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

body.login-page-lex .lex-dev-line a {
    color: #c9a84c;
    text-decoration: none;
    font-weight: 600;
}

body.login-page-lex .lex-dev-line a:hover {
    text-decoration: underline;
}

body.login-page-lex .lex-dev-logo-link {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

body.login-page-lex .lex-dev-logo-link:hover {
    opacity: 1;
}

body.login-page-lex .lex-dev-logo {
    max-height: 40px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

@media (max-width: 700px) {
    body.login-page-lex .lex-left {
        display: none;
    }

    body.login-page-lex .lex-right {
        padding: 32px 20px;
    }

    body.login-page-lex .lex-card {
        padding: 36px 28px;
    }
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
    .top-nav-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav {
        justify-content: flex-start;
        order: 3;
        width: 100%;
    }

    .user-pill {
        align-self: flex-end;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 16px 40px;
    }

    .top-nav-inner {
        padding: 12px 16px;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }
}
