/* ===========================================================
   Drive Plagas — Layout ejecutivo
   ===========================================================*/
:root {
    --dp-primary: #0d6efd;
    --dp-success: #198754;
    --dp-sidebar-bg: #1e2939;
    --dp-sidebar-bg-hover: #2a3645;
    --dp-sidebar-text: #c5cdd6;
    --dp-sidebar-text-active: #ffffff;
    --dp-sidebar-width: 240px;
    --dp-topbar-height: 64px;
    --dp-bg: #f4f6fa;
    --dp-radius: 0.65rem;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--dp-bg);
    color: #1f2937;
    margin: 0;
}

/* =========================================================== Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--dp-sidebar-width);
    display: flex;
    flex-direction: column;
}

/* =========================================================== Sidebar */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--dp-sidebar-width);
    height: 100vh;
    background: var(--dp-sidebar-bg);
    color: var(--dp-sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    height: var(--dp-topbar-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 4px;
}

.sidebar-brand-text {
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}

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

.sidebar-nav .nav-section {
    color: #6b7785;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1rem 1.25rem 0.5rem;
    list-style: none;
}

.sidebar-nav .nav-link {
    color: var(--dp-sidebar-text);
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-nav .nav-link:hover {
    background: var(--dp-sidebar-bg-hover);
    color: var(--dp-sidebar-text-active);
}

.sidebar-nav .nav-link.active {
    background: var(--dp-sidebar-bg-hover);
    color: var(--dp-sidebar-text-active);
    border-left-color: var(--dp-primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* =========================================================== Topbar */
.app-topbar {
    height: var(--dp-topbar-height);
    background: white;
    border-bottom: 1px solid #e5e9f0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-weight: 600;
    color: #374151;
    font-size: 1.05rem;
}

.sidebar-toggle {
    border: 0;
    background: transparent;
    color: #374151;
    font-size: 1.5rem;
    line-height: 1;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dp-primary);
    color: white;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    text-decoration: none;
}

/* =========================================================== Content */
.app-content {
    padding: 1.75rem 1.75rem 0.5rem;
    flex: 1;
}

.page-header h1 {
    color: #111827;
}

/* =========================================================== Stat cards */
.stat-card {
    border-radius: var(--dp-radius);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-title {
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.stat-subtitle {
    margin-top: 0.15rem;
}

/* =========================================================== Cards */
.card {
    border-radius: var(--dp-radius);
}

.card-header {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.card-title {
    color: #1f2937;
}

/* =========================================================== Tables */
.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5563;
    font-weight: 600;
}

/* =========================================================== Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}

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

/* =========================================================== Footer */
.app-footer {
    background: white;
    margin-top: auto;
}

/* =========================================================== Auth */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #0d6efd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
}

.auth-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 1rem;
    padding: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.06);
}

/* =========================================================== Responsive */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 1rem;
    }
}
