:root {
    --sa-primary: #5b5bd6;
    --sa-primary-dark: #4545b8;
    --sa-secondary: #14b8a6;

    --sa-bg: #f5f7fb;
    --sa-surface: #ffffff;
    --sa-surface-soft: #f9fafb;

    --sa-text: #1f2937;
    --sa-muted: #6b7280;

    --sa-border: #e5e7eb;

    --sa-success: #22c55e;
    --sa-warning: #f59e0b;
    --sa-danger: #ef4444;
    --sa-info: #3b82f6;

    --sa-sidebar-bg: #171a2b;
    --sa-sidebar-text: #d1d5db;
    --sa-sidebar-muted: #8b93a7;

    --sa-radius: 14px;
    --sa-radius-sm: 9px;

    --sa-shadow:
        0 4px 18px rgba(17, 24, 39, 0.06);
}


/* ==============================
   GENERAL
================================ */

body {
    background: var(--sa-bg);
    color: var(--sa-text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

#page-content-wrapper {
    background: var(--sa-bg);
    min-height: 100vh;
}

main {
    background: var(--sa-bg);
}


/* ==============================
   SIDEBAR
================================ */

#sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        linear-gradient(
            180deg,
            #171a2b 0%,
            #111422 100%
        );
    color: var(--sa-sidebar-text);
    min-height: 100vh;
    border-right: 0 !important;
}

.sidebar-header {
    padding: 24px 18px;
    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header .fs-4 {
    color: #ffffff;
    letter-spacing: -0.5px;
}

.sidebar-header small {
    color: var(--sa-sidebar-muted);
}

#sidebar .list-group {
    padding: 12px;
    flex: 1;
}

#sidebar .list-group-item {
    background: transparent;
    color: var(--sa-sidebar-text);
    border: 0;
    border-radius: 10px;
    margin-bottom: 4px;
    padding: 11px 13px;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

#sidebar .list-group-item:hover {
    background:
        rgba(255, 255, 255, 0.07);
    color: #ffffff;
    transform: translateX(2px);
}

#sidebar .list-group-item.active {
    background: var(--sa-primary);
    color: #ffffff;
}

#sidebar .list-group-item i {
    font-size: 1rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 10px 16px;
    text-align: center;

    border-top: 1px solid rgba(255,255,255,0.10);
}

.sidebar-footer-system {
    color: rgba(255,255,255,0.45);
    font-size: 10px;
    letter-spacing: 0.3px;
}

.sidebar-footer-developer {
    margin-top: 3px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
}


/* ==============================
   NAVBAR SUPERIOR
================================ */

.navbar {
    background: var(--sa-surface) !important;
    border-bottom:
        1px solid var(--sa-border) !important;
    min-height: 64px;
}

.navbar .btn {
    border-radius: var(--sa-radius-sm);
}

.topbar-brand-name {
    font-family: "Segoe Script", "Brush Script MT", cursive;

    font-size: 26px;
    font-weight: 600;

    color: #6b4967;

    opacity: 0.10;

    letter-spacing: 1px;

    font-style: italic;

    user-select: none;
    pointer-events: none;

    text-shadow:
        0 1px 0 rgba(255,255,255,0.7);
}


/* ==============================
   TARJETAS
================================ */

.card {
    border: 1px solid var(--sa-border) !important;
    border-radius: var(--sa-radius) !important;
    background: var(--sa-surface);
    box-shadow: var(--sa-shadow) !important;
}

.card-header {
    border-bottom:
        1px solid var(--sa-border) !important;
    background:
        var(--sa-surface) !important;
    border-radius:
        var(--sa-radius)
        var(--sa-radius)
        0
        0 !important;
}


/* ==============================
   BOTONES
================================ */

.btn {
    border-radius: var(--sa-radius-sm);
    font-weight: 500;
}

.btn-primary {
    background: var(--sa-primary);
    border-color: var(--sa-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--sa-primary-dark);
    border-color: var(--sa-primary-dark);
}

.btn-outline-primary {
    color: var(--sa-primary);
    border-color: var(--sa-primary);
}

.btn-outline-primary:hover {
    background: var(--sa-primary);
    border-color: var(--sa-primary);
}


/* ==============================
   FORMULARIOS
================================ */

.form-control,
.form-select,
.input-group-text {
    border-color: var(--sa-border);
    border-radius: var(--sa-radius-sm);
}

.form-control,
.form-select {
    background: var(--sa-surface);
    color: var(--sa-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sa-primary);
    box-shadow:
        0 0 0 0.2rem
        rgba(91, 91, 214, 0.14);
}

.form-label {
    font-weight: 500;
    color: var(--sa-text);
}


/* ==============================
   TABLAS
================================ */

.table {
    color: var(--sa-text);
}

.table > :not(caption) > * > * {
    padding-top: 12px;
    padding-bottom: 12px;
    border-color: var(--sa-border);
}

.table-light {
    --bs-table-bg: #f8f9fc;
    --bs-table-color: var(--sa-text);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg:
        rgba(91, 91, 214, 0.04);
}


/* ==============================
   MODALES
================================ */

.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow:
        0 20px 60px
        rgba(17, 24, 39, 0.18);
}

.modal-header {
    border-bottom:
        1px solid var(--sa-border);
}

.modal-footer {
    border-top:
        1px solid var(--sa-border);
}


/* ==============================
   BADGES / ESTADOS
================================ */

.badge {
    border-radius: 999px;
    font-weight: 500;
    padding:
        6px 10px;
}


/* ==============================
   TEXTOS
================================ */

.text-muted,
.text-secondary {
    color:
        var(--sa-muted) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--sa-text);
}


/* ==============================
   SCROLLBAR
================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c7cbd4;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aeb4c0;
}


/* ==============================
   MODO OSCURO
================================ */

body.dark-mode {

    --sa-bg: #11131d;
    --sa-surface: #1a1d29;
    --sa-surface-soft: #202432;

    --sa-text: #eef0f6;
    --sa-muted: #9ca3af;

    --sa-border: #2d3140;

    --sa-sidebar-bg: #0d0f18;

    --sa-shadow:
        0 4px 18px
        rgba(0, 0, 0, 0.22);
}

body.dark-mode .navbar,
body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .modal-content,
body.dark-mode .form-control,
body.dark-mode .form-select {
    background:
        var(--sa-surface) !important;
    color:
        var(--sa-text) !important;
}

body.dark-mode .table-light {
    --bs-table-bg: #202432;
    --bs-table-color: #eef0f6;
}

body.dark-mode .input-group-text {
    background: #202432;
    color: var(--sa-text);
    border-color: var(--sa-border);
}
.sidebar-logo {
    width: 95px;
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-header {
    padding: 8px 8px 8px;
    text-align: center;
}

.sidebar-header small {
    display: block;
    margin-top: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}



.login-logo {
    width: 90px;
    height: auto;
    margin-bottom: 8px;
}

.card-body {
    padding-top: 25px !important;
    padding-bottom: 25px !important;
}

.nombre-serviagenda {
    font-size: 2rem !important;
    font-weight: 700 !important;
    font-style: italic;
    letter-spacing: 0.5px;

    background: linear-gradient(
        90deg,
        #7a275f,
        #d63384,
        #f062a6
    );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Logo de ServiAgenda en la barra superior */
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.topbar-brand-icon {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}
