:root {
    --ink: #1f2933;
    --muted: #667085;
    --line: #e6e9ef;
    --surface: #ffffff;
    --soft: #f6f7fb;
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #10b981;
}

* { box-sizing: border-box; }
html {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 100vw;
    align-items: stretch;
    background: linear-gradient(90deg, #111827 0 260px, var(--soft) 260px 100%);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    align-self: start;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 18px;
    background: #111827;
    color: #fff;
}

.brand {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 20px;
    background: #111827;
}

.brand-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-weight: 800;
    overflow: hidden;
    flex: 0 0 auto;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.brand-mark span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: #f59e0b;
}

.brand small {
    display: block;
    color: #b6c0d2;
    font-size: .78rem;
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.main {
    min-width: 0;
    grid-column: 2;
    padding: 112px 26px 26px;
}
.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 22px 26px 18px;
    background: rgba(246, 247, 251, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar h1 {
    font-size: 1.7rem;
    margin: 0;
    font-weight: 760;
}

.topbar p {
    color: var(--muted);
    margin: 4px 0 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 12px;
    white-space: nowrap;
}

.user-chip a { color: var(--muted); }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(17,24,39,.04);
    min-width: 0;
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-body { padding: 20px; }
.metric {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-height: 116px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 1.8rem;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.table thead th {
    background: #111827;
    color: #ffffff;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    border-bottom-color: #111827;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: .78rem;
    font-weight: 650;
}

.status.pending { background: #fff7ed; color: #b45309; }
.status.done { background: #ecfdf3; color: #047857; }

.login-page {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.72)),
        url("assets/login-cover.png") center / cover no-repeat;
}

.login-card {
    width: min(1020px, 100%);
    height: min(620px, calc(100vh - 36px));
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(17,24,39,.18);
}

.login-cover {
    position: relative;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(17,24,39,.12), rgba(17,24,39,.44)),
        url("assets/login-cover.png") center / cover no-repeat;
}

.login-cover-panel {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px;
    color: #fff;
    background: rgba(17,24,39,.38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-cover-panel span {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 6px;
    color: rgba(255,255,255,.78);
}

.login-cover-panel strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px 44px;
    overflow: auto;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.login-brand .login-brand-mark {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(17,24,39,.08);
}

.login-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.login-brand-mark span {
    font-weight: 800;
    color: #111827;
}

.login-brand-title {
    display: block;
    font-size: 1.75rem;
    line-height: 1.05;
    margin-bottom: 4px;
}

.login-form .form-label {
    color: #344054;
    font-weight: 650;
    margin-bottom: 7px;
}

.login-input {
    position: relative;
}

.login-input > i,
.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    color: #667085;
    pointer-events: none;
}

.login-input .form-control {
    min-height: 48px;
    padding-left: 42px;
    border-color: #d7dce5;
    border-radius: 8px;
}

.login-input.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.login-password-toggle {
    width: 52px;
    border-color: #d7dce5;
    border-radius: 0 8px 8px 0;
}

.login-submit {
    min-height: 48px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 12px 22px rgba(37,99,235,.22);
}


.img-ajustada {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
        background: var(--soft);
    }
    .sidebar {
        position: sticky;
        left: auto;
        bottom: auto;
        width: auto;
        top: 0;
        z-index: 40;
        height: auto;
        overflow: visible;
        padding: 12px 14px;
    }
    .brand {
        position: static;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    .brand-mark {
        width: 44px;
        height: 44px;
        font-size: .9rem;
    }
    .sidebar .nav {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
        max-width: calc(100vw - 28px);
    }
    .sidebar .nav-link {
        flex: 0 0 auto;
        padding: 9px 11px;
    }
    .main {
        grid-column: auto;
        width: 100%;
        max-width: 100vw;
        padding: 0 14px 18px;
    }
    .topbar {
        position: sticky;
        left: auto;
        right: auto;
        align-items: flex-start;
        flex-direction: column;
    }
    .topbar {
        margin: 0 -14px 18px;
        padding: 16px 14px;
    }
    .topbar h1 { font-size: 1.35rem; }
    .topbar p { font-size: .9rem; }
    .user-chip {
        max-width: 100%;
        white-space: normal;
    }
    .row {
        --bs-gutter-x: 1rem;
    }
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .panel-header .btn,
    .panel-header form,
    .panel-header select {
        width: 100%;
    }
    .panel-body { padding: 16px; }
    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
    }
    .login-card {
        grid-template-columns: 1fr;
        height: auto;
        max-height: calc(100vh - 36px);
        overflow: auto;
    }
    .login-cover {
        min-height: 260px;
    }
    .login-cover-panel {
        left: 18px;
        right: 18px;
        bottom: 18px;
        padding: 18px;
    }
    .login-cover-panel strong {
        font-size: 1.45rem;
    }
    .login-form {
        padding: 34px;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .brand small { display: none; }
    .brand {
        gap: 10px;
    }
    .brand > div:last-child {
        min-width: 0;
    }
    .brand strong {
        display: block;
        max-width: calc(100vw - 88px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .sidebar .nav-link span { display: none; }
    .sidebar .nav-link {
        width: 42px;
        height: 40px;
        justify-content: center;
        padding: 0;
    }
    .sidebar .nav-link i { font-size: 1.05rem; }
    .login-page {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        padding: 16px;
    }
    .login-card { grid-template-columns: 1fr; }
    .login-cover { min-height: 190px; }
    .login-cover-panel { display: none; }
    .login-form { padding: 24px; }
    .login-brand-title { font-size: 1.55rem; }
    .login-brand .login-brand-mark {
        width: 58px;
        height: 58px;
    }
    .btn,
    .form-control,
    .form-select,
    .input-group {
        max-width: 100%;
    }
}
