@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #020617;
    --bg-soft: #071127;
    --surface: #0b1429;
    --surface-soft: rgba(15, 23, 42, 0.72);
    --surface-light: #111d35;
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-light: #cbd5e1;
    --line: rgba(148, 163, 184, 0.16);
    --line-blue: rgba(56, 189, 248, 0.3);
    --blue: #2563eb;
    --cyan: #38bdf8;
    --cyan-light: #67e8f9;
    --green: #22c55e;
    --yellow: #fbbf24;
    --red: #f87171;
    --radius: 18px;
    --sidebar-width: 252px;
    --header-height: 76px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 5%, rgba(37, 99, 235, 0.1), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
    line-height: 1.6;
}

body.sidebar-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

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

:focus-visible {
    outline: 3px solid var(--cyan-light);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 10px;
    background: #fff;
    color: var(--bg);
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--cyan);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.eyebrow::before {
    width: 18px;
    height: 1px;
    background: currentColor;
    content: "";
}

.admin-logo {
    display: inline-block;
    border-radius: 8px;
}

.admin-logo img {
    width: 202px;
}

.admin-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.admin-button:hover {
    transform: translateY(-2px);
}

.admin-button-primary {
    background: linear-gradient(135deg, var(--blue), #0ea5e9);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.27);
    color: #fff;
}

.admin-button-secondary {
    border-color: var(--line);
    background: rgba(15, 23, 42, 0.58);
    color: var(--muted-light);
}

.admin-button-secondary:hover {
    border-color: rgba(56, 189, 248, 0.42);
    color: var(--cyan-light);
}

.login-public-link {
    width: 100%;
    margin-top: 12px;
}

/* Forms and authentication */

.auth-page {
    display: flex;
    flex-direction: column;
}

.auth-shell {
    min-height: calc(100vh - 58px);
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(440px, 1.05fr);
}

.auth-brand {
    position: relative;
    min-height: 720px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(34px, 6vw, 78px);
    border-right: 1px solid var(--line);
    background:
        linear-gradient(145deg, rgba(3, 10, 27, 0.96), rgba(5, 16, 39, 0.91)),
        url("../../assets/server.png") center / cover;
}

.auth-brand::after {
    position: absolute;
    right: -180px;
    bottom: -180px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.2);
    filter: blur(80px);
    content: "";
}

.auth-brand > * {
    position: relative;
    z-index: 2;
}

.auth-brand h1 {
    max-width: 650px;
    margin-top: 18px;
    font-size: clamp(2.5rem, 5vw, 4.8rem);
    letter-spacing: -0.055em;
    line-height: 1;
}

.auth-brand p {
    margin-top: 22px;
    color: var(--muted-light);
}

.auth-brand-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.auth-brand-grid span {
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    opacity: 0.3;
}

.auth-brand-grid span:nth-child(2),
.auth-brand-grid span:nth-child(5) {
    opacity: 0.8;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 40px;
    background:
        linear-gradient(rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.98)),
        radial-gradient(circle at center, rgba(37, 99, 235, 0.2), transparent 28rem);
}

.auth-card {
    width: min(100%, 450px);
    padding: clamp(28px, 5vw, 46px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(10, 19, 39, 0.86);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.status-pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.auth-card h2,
.setup-card h1 {
    margin-top: 22px;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.auth-intro,
.setup-card > p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-form {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.field {
    min-width: 0;
}

.field label,
.field-heading {
    color: var(--muted-light);
    font-size: 0.76rem;
    font-weight: 700;
}

.field-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.field-heading a {
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
}

.field input {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(2, 6, 23, 0.68);
    color: var(--text);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
    outline: none;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 70px;
}

.password-toggle {
    position: absolute;
    top: 15px;
    right: 10px;
    min-width: 48px;
    min-height: 36px;
    border: 0;
    background: transparent;
    color: var(--cyan);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 800;
}

.security-note {
    margin-top: 24px;
    color: #64748b;
    font-size: 0.67rem;
    text-align: center;
}

.alert {
    margin-top: 20px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 0.78rem;
}

.alert ul {
    margin: 8px 0 0 18px;
}

.alert-error {
    border-color: rgba(248, 113, 113, 0.25);
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(20, 83, 45, 0.18);
    color: #bbf7d0;
}

.alert-warning {
    border-color: rgba(251, 191, 36, 0.24);
    background: rgba(120, 53, 15, 0.17);
    color: #fde68a;
}

.alert-info {
    border-color: var(--line-blue);
    background: rgba(30, 64, 175, 0.13);
    color: #bfdbfe;
}

.setup-shell {
    min-height: calc(100vh - 58px);
    display: grid;
    place-items: center;
    padding: clamp(26px, 6vw, 72px) 20px;
}

.setup-card {
    width: min(100%, 720px);
    padding: clamp(28px, 6vw, 58px);
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(10, 19, 39, 0.88);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.setup-card .admin-logo {
    display: block;
    margin-bottom: 38px;
}

.setup-card > .admin-button {
    margin-top: 25px;
}

.setup-form {
    margin-top: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field-help {
    color: var(--muted);
    font-size: 0.72rem;
}

.compact-card {
    max-width: 540px;
}

.feature-pending {
    margin-top: 26px;
    padding: 14px;
    border-left: 3px solid var(--cyan);
    background: rgba(56, 189, 248, 0.07);
    color: var(--muted-light);
    font-size: 0.75rem;
}

.back-link {
    display: inline-block;
    margin-top: 22px;
    color: var(--cyan);
    font-size: 0.8rem;
    text-decoration: none;
}

.setup-success {
    text-align: center;
}

.success-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    border: 1px solid rgba(34, 197, 94, 0.36);
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    font-size: 1.5rem;
    font-weight: 900;
}

/* Dashboard */

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 700;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: #050b1a;
}

.sidebar-brand {
    min-height: var(--header-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
    width: 170px;
}

.sidebar-brand > span {
    color: #64748b;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 24px 14px;
}

.sidebar nav a,
.disabled-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(37, 99, 235, 0.14);
    color: #fff;
}

.disabled-link {
    cursor: not-allowed;
    opacity: 0.45;
}

.nav-section {
    margin: 20px 12px 5px;
    color: #526077;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.nav-symbol {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--cyan);
    font-size: 0.65rem;
    font-weight: 800;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 25px;
    border-top: 1px solid var(--line);
}

.sidebar-footer a {
    color: var(--muted);
    font-size: 0.72rem;
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: var(--cyan-light);
}

.dashboard-main {
    min-width: 0;
    grid-column: 2;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 600;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(15px);
}

.sidebar-toggle {
    width: 44px;
    height: 44px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: #fff;
    cursor: pointer;
}

.sidebar-toggle span {
    width: 19px;
    height: 2px;
    background: currentColor;
}

.dashboard-context span,
.dashboard-context strong {
    display: block;
}

.dashboard-context span {
    color: var(--muted);
    font-size: 0.63rem;
}

.dashboard-context strong {
    font-size: 0.82rem;
}

.dashboard-public-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted-light);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-public-link:hover {
    border-color: rgba(56, 189, 248, 0.42);
    color: var(--cyan-light);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-left: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-blue);
    border-radius: 11px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--cyan-light);
    font-size: 0.72rem;
    font-weight: 800;
}

.user-summary strong,
.user-summary span {
    display: block;
}

.user-summary strong {
    font-size: 0.75rem;
}

.user-summary span {
    color: var(--muted);
    font-size: 0.62rem;
}

.logout-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
    color: var(--muted-light);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
}

.logout-button:hover {
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecaca;
}

.dashboard-content {
    width: min(calc(100% - 48px), 1450px);
    margin: 0 auto;
    padding: 46px 0 72px;
}

.welcome-block {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 46px;
}

.welcome-block h1 {
    margin-top: 12px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.welcome-block p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.86rem;
}

.environment-badge {
    padding: 7px 10px;
    border: 1px solid var(--line-blue);
    border-radius: 8px;
    color: var(--cyan);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-title-row h2,
.roadmap-panel h2 {
    font-size: 1rem;
}

.section-title-row p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.7rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
}

.dashboard-card {
    min-height: 150px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-soft);
}

.dashboard-card-linked {
    border-color: rgba(56, 189, 248, 0.24);
}

.card-link {
    color: var(--cyan-light);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
}

.card-link:hover {
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.metric-symbol {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-blue);
    border-radius: 9px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--cyan);
    font-size: 0.65rem;
    font-weight: 800;
}

.dashboard-card div strong,
.dashboard-card div span {
    display: block;
}

.dashboard-card div strong {
    font-size: 1.65rem;
    line-height: 1;
}

.dashboard-card div span {
    margin-top: 7px;
    color: var(--muted-light);
    font-size: 0.73rem;
}

.dashboard-card small {
    grid-column: 1 / -1;
    align-self: end;
    color: #5e6c82;
    font-size: 0.62rem;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
    margin-top: 42px;
}

.activity-panel,
.roadmap-panel {
    min-height: 390px;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.empty-state {
    min-height: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-state > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 17px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--cyan);
    letter-spacing: 0.14em;
}

.empty-state strong {
    color: var(--muted-light);
    font-size: 0.82rem;
}

.empty-state p {
    max-width: 330px;
    margin-top: 8px;
    font-size: 0.7rem;
}

.activity-list {
    display: grid;
    margin-top: 25px;
    list-style: none;
}

.activity-list li {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.activity-list li:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.activity-list strong {
    font-size: 0.76rem;
    text-transform: capitalize;
}

.activity-list p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.69rem;
}

.activity-list small {
    display: block;
    margin-top: 5px;
    color: #59677c;
    font-size: 0.6rem;
}

.roadmap-panel {
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.12), rgba(15, 23, 42, 0.72)),
        var(--surface-soft);
}

.roadmap-panel h2 {
    margin-top: 18px;
    font-size: 1.35rem;
}

.roadmap-panel > p {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.76rem;
}

.roadmap-panel ul {
    display: grid;
    gap: 10px;
    margin-top: 25px;
    list-style: none;
}

.roadmap-panel li {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--muted-light);
    font-size: 0.73rem;
}

.roadmap-panel li span {
    color: var(--cyan);
    font-size: 0.61rem;
    font-weight: 800;
}

.roadmap-note {
    margin-top: 28px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.65rem;
}

.admin-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 15px 20px;
    border-top: 1px solid var(--line);
    background: #010411;
    color: #5d6b80;
    font-size: 0.65rem;
}

.dashboard-page > .admin-footer {
    margin-left: var(--sidebar-width);
}

.admin-footer a {
    color: var(--cyan);
    text-decoration: none;
}

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-card:nth-child(n + 4) {
        min-height: 130px;
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 390px;
        padding: 36px;
    }

    .auth-brand h1 {
        max-width: 600px;
        font-size: clamp(2.4rem, 8vw, 4rem);
    }

    .auth-brand-grid {
        max-width: 500px;
    }

    .auth-panel {
        min-height: 590px;
    }

    .dashboard-shell {
        display: block;
    }

    .sidebar {
        width: min(82vw, var(--sidebar-width));
        box-shadow: 30px 0 70px rgba(0, 0, 0, 0.5);
        transform: translateX(-105%);
        transition: transform 200ms ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-main {
        grid-column: auto;
    }

    .sidebar-toggle {
        display: flex;
    }

    .dashboard-page > .admin-footer {
        margin-left: 0;
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .auth-panel {
        padding: 24px 14px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        padding-inline: 14px;
    }

    .dashboard-context {
        display: none;
    }

    .user-summary {
        display: none;
    }

    .dashboard-public-link span:last-child {
        max-width: 62px;
        line-height: 1.15;
    }

    .dashboard-content {
        width: calc(100% - 28px);
        padding-top: 30px;
    }

    .welcome-block {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-card {
        min-height: 135px;
    }
}

@media (max-width: 440px) {
    .auth-brand {
        min-height: 340px;
        padding: 26px 20px;
    }

    .auth-brand h1 {
        font-size: 2.5rem;
    }

    .admin-logo img {
        width: 176px;
    }

    .setup-shell {
        padding-inline: 12px;
    }

    .setup-card {
        padding: 27px 19px;
    }

    .logout-button {
        padding-inline: 9px;
    }

    .dashboard-header {
        gap: 8px;
    }

    .dashboard-public-link {
        padding-inline: 9px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 125px;
    }

    .admin-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.admin-module {
    --module-border: rgba(148, 163, 184, 0.16);
}

.module-heading,
.section-title-row,
.form-actions,
.metadata,
.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-heading {
    justify-content: space-between;
    margin-bottom: 28px;
}

.module-heading h1 {
    margin: 5px 0 3px;
    font-size: clamp(2rem, 4vw, 3.3rem);
}

.module-heading p,
.section-title-row p {
    color: var(--muted);
}

.filter-panel,
.module-form,
.detail-card,
.related-section,
.module-empty {
    border: 1px solid var(--module-border);
    border-radius: 16px;
    background: rgba(8, 15, 32, 0.75);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(135px, 1fr)) auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 22px;
    padding: 18px;
}

.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.82);
    color: var(--text);
    font: inherit;
}

.field select {
    min-height: 48px;
    padding: 10px 12px;
}

.field textarea {
    padding: 12px;
    resize: vertical;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #fca5a5;
    font-size: 0.72rem;
}

.table-wrap {
    border: 1px solid var(--module-border);
    border-radius: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    background: rgba(8, 15, 32, 0.72);
}

.data-table th,
.data-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--module-border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #8390a5;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table td {
    color: var(--muted-light);
    font-size: 0.77rem;
}

.data-table td strong,
.data-table td small {
    display: block;
}

.data-table td strong {
    color: var(--text);
}

.data-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.data-table a,
.table-actions button {
    color: var(--cyan-light);
}

.table-actions {
    flex-wrap: wrap;
}

.table-actions a,
.table-actions button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 0.7rem;
    text-decoration: none;
}

.status-badge,
.priority-badge {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.65rem;
}

.status-cliente,
.text-active { color: #86efac; }
.status-descartado,
.text-inactive { color: #fca5a5; }
.status-contactado { color: #7dd3fc; }
.status-en_analisis { color: #fde68a; }
.priority-alta { color: #fca5a5; border-color: rgba(248,113,113,.3); }
.priority-media { color: #fde68a; }
.priority-baja { color: #94a3b8; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.pagination a {
    min-width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted-light);
    text-decoration: none;
}

.pagination a.active {
    border-color: var(--cyan);
    background: rgba(37, 99, 235, 0.2);
    color: #fff;
}

.module-empty {
    padding: 55px 25px;
    text-align: center;
}

.module-empty strong {
    display: block;
    margin-bottom: 7px;
    font-size: 1rem;
}

.module-empty p {
    color: var(--muted);
}

.module-form {
    padding: 24px;
}

.form-section + .form-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--module-border);
}

.form-section h2,
.detail-card h2,
.related-section h2 {
    margin-bottom: 17px;
    font-size: 1rem;
}

.module-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 18px;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted-light);
    font-size: 0.8rem;
}

.check-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.form-actions {
    flex-wrap: wrap;
    margin-top: 26px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-card,
.related-section {
    padding: 24px;
}

.detail-card + .related-section,
.related-section {
    margin-top: 20px;
}

.detail-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.detail-card dt {
    color: var(--muted);
    font-size: 0.68rem;
}

.detail-card dd {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 0.82rem;
}

.preline {
    color: var(--muted-light);
    white-space: pre-line;
}

.metadata {
    flex-wrap: wrap;
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.68rem;
}

.section-title-row {
    justify-content: space-between;
    margin-bottom: 18px;
}

@media (max-width: 1050px) {
    .filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .module-heading,
    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-panel,
    .module-form-grid,
    .detail-grid,
    .detail-card dl {
        grid-template-columns: 1fr;
    }

    .filter-panel,
    .module-form,
    .detail-card,
    .related-section {
        padding: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
