:root {
    --bg-main: #050814;
    --bg-elevated: #0e1527;
    --bg-card: #111927;
    --bg-soft: #151d2f;
    --sidebar-bg: #050814;
    --accent: #1D7192;
    --accent-soft: rgba(29, 113, 146, 0.18);
    --accent-strong: #11b3ff;
    --border-subtle: #20293a;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-soft: 0 18px 40px rgba(0,0,0,0.55);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --transition-fast: 0.16s ease-out;
    --transition-med: 0.22s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #111827 0, #020617 40%, #000 100%);
    color: var(--text-main);
    font-family: var(--font-main);
}

/* LAYOUT */

.layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #020617 0%, #020617 40%, #020617 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 8px 0 30px rgba(0,0,0,0.55);
    padding: 18px 18px 24px 18px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148,163,184,0.2);
}

.sidebar-logo {
    max-width: 168px;
}

.sidebar-app-name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--text-muted);
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #6b7280;
    margin: 12px 8px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin: 0 4px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.sidebar-link .icon {
    width: 22px;
    text-align: center;
    font-size: 14px;
}

.sidebar-link:hover {
    background: rgba(148, 163, 184, 0.10);
    color: var(--text-main);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: linear-gradient(120deg, rgba(17,120,255,0.18), rgba(37,197,235,0.20));
    color: #e5f3ff;
    border: 1px solid rgba(56,189,248,0.5);
}

.sidebar-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(148,163,184,0.3);
}

/* MAIN */

.main {
    flex: 1;
    padding: 16px 22px 22px 22px;
}

/* TOPBAR */

.topbar {
    background: radial-gradient(circle at top left, #1f2937 0, #020617 65%);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148,163,184,0.25);
    margin-bottom: 18px;
}

.topbar-title {
    margin: 0;
    font-size: 20px;
    letter-spacing: .04em;
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(148,163,184,0.4);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1D7192, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* FLASHES */

.flash-container {
    margin-bottom: 10px;
}

.flash {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    margin-bottom: 4px;
}

.flash-success {
    background: rgba(34,197,94,0.14);
    color: #bbf7d0;
    border: 1px solid rgba(34,197,94,0.45);
}

.flash-danger {
    background: rgba(239,68,68,0.14);
    color: #fecaca;
    border: 1px solid rgba(239,68,68,0.55);
}

/* PAGE */

.page-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* CARDS */

.card {
    background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

/* BADGES / PILL */

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}

.pill-soft {
    background: rgba(148,163,184,0.14);
    color: #e5e7eb;
}

.pill-success {
    background: rgba(34,197,94,0.18);
    color: #bbf7d0;
}

.pill-warning {
    background: rgba(245,158,11,0.18);
    color: #fed7aa;
}

.pill-danger {
    background: rgba(239,68,68,0.18);
    color: #fecaca;
}

.pill-info {
    background: rgba(59,130,246,0.18);
    color: #bfdbfe;
}

/* BUTTONS */

.btn {
    border-radius: 999px;
    font-size: 13px;
    padding: 7px 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition-med), transform var(--transition-fast), box-shadow var(--transition-fast), border var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: white;
    box-shadow: 0 12px 25px rgba(59,130,246,0.45);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(59,130,246,0.55);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(148,163,184,0.5);
}

.btn-outline:hover {
    background: rgba(148,163,184,0.18);
}

.btn-ghost {
    background: rgba(15,23,42,0.6);
    color: var(--text-main);
    border: 1px solid rgba(148,163,184,0.3);
}

.btn-ghost:hover {
    background: rgba(15,23,42,0.9);
}

/* FORMS */

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

label {
    font-size: 12px;
    color: var(--text-muted);
}

.input, .select, .textarea {
    width: 100%;
    margin-top: 4px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(31,41,55,0.9);
    background: rgba(15,23,42,0.9);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    color-scheme: dark;
}

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.45);
    background: #020617;
}

textarea.textarea {
    min-height: 80px;
    resize: vertical;
}

/* TABLES */

.table-wrapper {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    background: rgba(15,23,42,0.85);
    box-shadow: var(--shadow-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead {
    background: rgba(15,23,42,1);
}

thead th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-subtle);
}

tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(31,41,55,0.8);
}

tbody tr:nth-child(even) {
    background: rgba(15,23,42,0.7);
}

/* FILTER BAR */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.filter-actions {
    display: flex;
    gap: 8px;
}
.row-click {
    cursor: pointer;
    transition: background 0.15s ease;
}

.row-click:hover {
    background: rgba(59, 130, 246, 0.15); /* azul leve no hover */
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
    .main {
        padding: 10px;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
/* ===================== INPUTS MODERNOS – OMEGA ===================== */

.input,
.textarea,
select {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.85),
        rgba(2, 6, 23, 0.95)
    );
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 12px 14px;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-weight: 500;

    box-shadow:
        0 1px 0 rgba(255,255,255,0.04) inset,
        0 12px 28px rgba(2,6,23,0.6);

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .12s ease,
        background .18s ease;
}

/* Placeholder elegante */
.input::placeholder,
.textarea::placeholder {
    color: #94a3b8;
    opacity: .55;
}

/* Hover */
.input:hover,
.textarea:hover,
select:hover {
    border-color: rgba(56, 189, 248, 0.55);
}

/* Focus – glow moderno */
.input:focus,
.textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.9);

    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.45),
        0 0 0 6px rgba(56, 189, 248, 0.12),
        0 18px 40px rgba(2,6,23,0.85);

    transform: translateY(-1px);
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.95),
        rgba(2, 6, 23, 1)
    );
}

/* Textarea ajustes */
.textarea {
    resize: vertical;
    min-height: 90px;
}

/* Inputs desabilitados */
.input:disabled,
.textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.55);
}

/* ===================== LABELS MAIS MODERNOS ===================== */

label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: #cbd5f5;
    margin-bottom: 6px;
    display: inline-block;
}

/* ===================== SELECT (DROPDOWN) ===================== */

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #38bdf8 50%),
        linear-gradient(135deg, #38bdf8 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

/* Native selects in dark mode (opened menu/options) */
select,
select.input,
.select {
    background-color: rgba(15,23,42,0.95);
    color: var(--text-main);
    color-scheme: dark;
}

select option,
select optgroup {
    background-color: #0b1220;
    color: #e5e7eb;
}

select option:checked {
    background-color: #14324a;
    color: #e0f2fe;
}