:root {
    --minalum-orange: #f97400;
    --minalum-orange-light: #ff9433;
    --shell-dark: #12141a;
    --shell-dark-2: #1c1f28;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--shell-dark);
    color: #eee;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid #23262f;
}

.sidebar-logo img {
    max-width: 130px;
    height: auto;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
}

.sidebar-group-label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: #6b6f7a;
    text-transform: uppercase;
    padding: 1rem 1.25rem 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.25rem;
    color: #c7c9d1;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--shell-dark-2);
    color: #fff;
}

.sidebar-link.active {
    background-color: var(--shell-dark-2);
    color: #fff;
    border-left-color: var(--minalum-orange);
}

.sidebar-link .icon {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(249, 116, 0, 0.32), transparent 55%),
        radial-gradient(circle at 88% 82%, rgba(249, 116, 0, 0.24), transparent 60%),
        linear-gradient(160deg, var(--shell-dark) 0%, #1c1f28 55%, #20150a 100%);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(28, 31, 40, 0.9);
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid #2f333f;
}

.topbar h1 {
    font-size: 1.25rem;
    margin: 0;
    color: #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--shell-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.topbar-user-info {
    line-height: 1.2;
    text-align: right;
}

.topbar-user-info .name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #fff;
}

.topbar-user-info .role {
    font-size: 0.75rem;
    color: #9a9ea8;
}

.btn-logout {
    border: 1px solid #3a3f4c;
    background-color: rgba(28, 31, 40, 0.9);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ddd;
    font-size: 1rem;
}

.btn-logout:hover {
    background-color: var(--shell-dark-2);
}

.content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.content .card {
    background-color: rgba(28, 31, 40, 0.9);
    border: 1px solid #2f333f;
}

/* Dashboard */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #12141a;
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background-color: rgba(18, 20, 26, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card > div {
    min-width: 0;
}

.stat-card .value {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: break-word;
}

.stat-card .value.value-money {
    font-size: clamp(0.8rem, 1.15vw, 1rem);
}

.stat-card .label {
    font-size: 0.85rem;
    opacity: 0.92;
}

.stat-blue,
.stat-green,
.stat-purple,
.stat-orange {
    background-color: var(--minalum-orange);
}

.dash-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    align-items: start;
}

.panel {
    background-color: rgba(28, 31, 40, 0.9);
    border-radius: 12px;
    border: 1px solid #2f333f;
    overflow: hidden;
}

.panel-header {
    background-color: var(--shell-dark);
    color: #fff;
    padding: 0.75rem 1.1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.panel-body {
    padding: 1rem;
}

.quick-link {
    display: block;
    padding: 0.65rem 0.9rem;
    border: 1px solid #3a3f4c;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: #eee;
    font-size: 0.9rem;
}

.quick-link:last-child {
    margin-bottom: 0;
}

.quick-link:hover {
    background-color: var(--shell-dark-2);
    border-color: var(--minalum-orange);
    color: #fff;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #2f333f;
    font-size: 0.9rem;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-badge {
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}

.account-card {
    text-align: center;
}

.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--shell-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0 auto 0.75rem;
}

.account-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}

.account-mail {
    color: #9a9ea8;
    font-size: 0.85rem;
}

.account-role-badge {
    display: inline-block;
    margin-top: 0.5rem;
    background-color: var(--minalum-orange);
    color: #111;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
}

.account-meta {
    color: #9a9ea8;
    font-size: 0.78rem;
    margin-top: 0.85rem;
    border-top: 1px solid #2f333f;
    padding-top: 0.6rem;
}

/* Login */
.auth-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(249, 116, 0, 0.45), transparent 55%),
        radial-gradient(circle at 88% 82%, rgba(249, 116, 0, 0.32), transparent 60%),
        linear-gradient(160deg, var(--shell-dark) 0%, #1c1f28 55%, #20150a 100%);
}

.login-card {
    background-color: rgba(28, 31, 40, 0.9);
    border: 1px solid #2f333f;
}

.login-logo {
    max-width: 170px;
    height: auto;
}

.btn-brand {
    background-color: var(--minalum-orange);
    border-color: var(--minalum-orange);
    color: #12141a;
    font-weight: 600;
}

.btn-brand:hover,
.btn-brand:focus {
    background-color: var(--minalum-orange-light);
    border-color: var(--minalum-orange-light);
    color: #12141a;
}

/* Botones de acción principal (antes azules) */
.btn-primary {
    background-color: var(--minalum-orange);
    border-color: var(--minalum-orange);
    color: #000;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--minalum-orange-light) !important;
    border-color: var(--minalum-orange-light) !important;
    color: #000 !important;
}

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

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--minalum-orange) !important;
    border-color: var(--minalum-orange) !important;
    color: #000 !important;
}

/* Botones de cancelar */
.btn-cancel {
    background-color: #fff;
    border-color: #dc3545;
    color: #dc3545;
}

.btn-cancel:hover,
.btn-cancel:focus,
.btn-cancel:active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
    }
    .sidebar-logo img {
        max-width: 40px;
    }
    .sidebar-group-label,
    .sidebar-link span.label {
        display: none;
    }
    .sidebar-link {
        justify-content: center;
        padding: 0.7rem 0.5rem;
    }
    .topbar-user-info {
        display: none;
    }
}
