/**
 * SISTEMA DE CONTROL DE ACTIVIDADES DE TABACO - TABACALERA LA MECA
 * Heritage Precision Design System
 */

/* =============================================
   Design Tokens
   ============================================= */
:root {
    /* Color Palette */
    --ds-surface: #fbf9f4;
    --ds-surface-dim: #dbdad5;
    --ds-surface-bright: #fbf9f4;
    --ds-surface-container-lowest: #ffffff;
    --ds-surface-container-low: #f5f3ee;
    --ds-surface-container: #f0ede8;
    --ds-surface-container-high: #eae7e2;
    --ds-surface-container-highest: #e4e2dc;
    --ds-on-surface: #1b1c18;
    --ds-on-surface-variant: #44483d;
    --ds-outline: #75796c;
    --ds-outline-variant: #c5c8ba;
    --ds-primary: #1b3022;
    --ds-on-primary: #ffffff;
    --ds-primary-container: #d1eadd;
    --ds-on-primary-container: #002114;
    --ds-secondary: #536356;
    --ds-on-secondary: #ffffff;
    --ds-secondary-container: #d6e8d8;
    --ds-on-secondary-container: #111f15;
    --ds-tertiary: #3e6374;
    --ds-on-tertiary: #ffffff;
    --ds-tertiary-container: #c1e8fb;
    --ds-on-tertiary-container: #001f29;
    --ds-error: #ba1a1a;
    --ds-on-error: #ffffff;
    --ds-error-container: #ffdad6;
    --ds-on-error-container: #410002;

    /* Spacing */
    --ds-unit: 4px;
    --ds-container-padding: 24px;
    --ds-element-gap: 16px;

    /* Typography */
    --ds-font: 'Hanken Grotesk', sans-serif;
    --ds-display: 700 57px/64px var(--ds-font);
    --ds-headline: 600 32px/40px var(--ds-font);
    --ds-title: 500 22px/28px var(--ds-font);
    --ds-body-lg: 400 16px/24px var(--ds-font);
    --ds-body-md: 400 14px/20px var(--ds-font);
    --ds-body-sm: 400 12px/16px var(--ds-font);

    /* Shapes */
    --ds-radius-default: 4px;
    --ds-radius-button: 100px;
    --ds-radius-card: 12px;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --navbar-height: 60px;

    /* Backward compat */
    --primary: #1b3022;
    --primary-dark: #0d1a12;
    --primary-light: #2a4532;
}

/* =============================================
   Bootstrap Overrides
   ============================================= */
:root {
    --bs-body-font-family: var(--ds-font);
    --bs-body-bg: var(--ds-surface);
    --bs-body-color: var(--ds-on-surface);
    --bs-primary: var(--ds-primary);
    --bs-primary-rgb: 27, 48, 34;
    --bs-success: var(--ds-primary);
    --bs-success-rgb: 27, 48, 34;
    --bs-secondary: var(--ds-secondary);
    --bs-secondary-rgb: 83, 99, 86;
    --bs-danger: var(--ds-error);
    --bs-danger-rgb: 186, 26, 26;
    --bs-warning: #c78800;
    --bs-warning-rgb: 199, 136, 0;
    --bs-info: var(--ds-tertiary);
    --bs-info-rgb: 62, 99, 116;
    --bs-light: var(--ds-surface-container-low);
    --bs-light-rgb: 245, 243, 238;
    --bs-dark: var(--ds-primary);
    --bs-dark-rgb: 27, 48, 34;
    --bs-border-color: var(--ds-outline-variant);
    --bs-border-radius: var(--ds-radius-default);
    --bs-border-radius-lg: var(--ds-radius-card);
}

/* =============================================
   Layout General
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--ds-font);
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    background: var(--ds-surface);
    color: var(--ds-on-surface);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--ds-primary);
    color: var(--ds-on-primary);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    background: rgba(255,255,255,0.06);
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 10px 24px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ds-font);
    border-radius: 0;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.08);
    border-left-color: rgba(255,255,255,0.4);
}

.sidebar-nav .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.12);
    border-left-color: var(--ds-secondary-container);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    background: rgba(255,255,255,0.06);
    margin-top: auto;
    color: rgba(255,255,255,0.6);
}

/* Sidebar collapsed */
.sidebar.collapsed {
    left: calc(var(--sidebar-width) * -1);
}

/* =============================================
   Contenido Principal
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 0;
}

.main-content main {
    flex: 1;
}

/* =============================================
   Navbar Superior
   ============================================= */
.top-navbar {
    height: var(--navbar-height);
    background: var(--ds-surface-container-lowest);
    border-bottom: 1px solid var(--ds-outline-variant);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* =============================================
   Tarjetas (Cards)
   ============================================= */
.card {
    border: 1px solid var(--ds-outline-variant);
    border-radius: var(--ds-radius-card) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
    background: var(--ds-surface-container-lowest);
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.card-header {
    background: var(--ds-surface-container-lowest);
    border-bottom: 1px solid var(--ds-outline-variant);
    border-radius: var(--ds-radius-card) var(--ds-radius-card) 0 0 !important;
    font-weight: 600;
    font-family: var(--ds-font);
}

.stat-card {
    border-left: 4px solid;
    padding: 1.5rem;
    border-radius: var(--ds-radius-card);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--ds-font);
}

.stat-card .stat-label {
    color: var(--ds-on-surface-variant);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* =============================================
   Tablas
   ============================================= */
.table-responsive {
    border-radius: var(--ds-radius-card);
    overflow: hidden;
}

.table thead th {
    background: var(--ds-primary);
    color: var(--ds-on-primary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 12px 16px;
    font-family: var(--ds-font);
}

.table tbody td {
    vertical-align: middle;
    padding: 12px 16px;
    font-size: 14px;
}

.table-hover tbody tr:hover {
    background: rgba(27, 48, 34, 0.04);
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--ds-outline-variant);
}

/* =============================================
   Formularios
   ============================================= */
.form-control {
    border-radius: var(--ds-radius-default);
    border-color: var(--ds-outline-variant);
    font-family: var(--ds-font);
    font-size: 14px;
    padding: 10px 14px;
    background: var(--ds-surface-container-lowest);
    color: var(--ds-on-surface);
}

.form-control-lg,
.form-control-sm {
    border-radius: var(--ds-radius-default);
}

.form-control:focus, .form-select:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(27, 48, 34, 0.12);
}

.form-label {
    font-weight: 500;
    color: var(--ds-on-surface-variant);
    font-size: 14px;
    font-family: var(--ds-font);
}

.form-select {
    border-radius: var(--ds-radius-default);
    border-color: var(--ds-outline-variant);
    font-family: var(--ds-font);
}

/* =============================================
   Botones
   ============================================= */
.btn {
    border-radius: var(--ds-radius-button) !important;
    font-family: var(--ds-font);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 24px;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
}

.btn:active {
    transform: scale(0.97);
}

.btn-success,
.btn-primary {
    background-color: var(--ds-primary);
    border-color: var(--ds-primary);
    color: var(--ds-on-primary);
}

.btn-success:hover,
.btn-primary:hover {
    background-color: #2a4532;
    border-color: #2a4532;
}

.btn-outline-success,
.btn-outline-primary {
    color: var(--ds-primary);
    border-color: var(--ds-primary);
}

.btn-outline-success:hover,
.btn-outline-primary:hover {
    background-color: var(--ds-primary);
    color: var(--ds-on-primary);
}

.btn-outline-secondary {
    color: var(--ds-secondary);
    border-color: var(--ds-outline-variant);
}

.btn-outline-secondary:hover {
    background-color: var(--ds-secondary);
    color: var(--ds-on-secondary);
    border-color: var(--ds-secondary);
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 4px 16px;
    font-size: 12px;
}

.btn-outline-danger {
    color: var(--ds-error);
    border-color: var(--ds-error);
}

.btn-outline-danger:hover {
    background-color: var(--ds-error);
    color: var(--ds-on-error);
}

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

.btn-dark:hover {
    background-color: #2a4532;
    border-color: #2a4532;
}

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

.btn-outline-dark:hover {
    background-color: var(--ds-primary);
    color: var(--ds-on-primary);
}

/* =============================================
   Alertas
   ============================================= */
.alert {
    border-radius: var(--ds-radius-card);
    border: 1px solid var(--ds-outline-variant);
    font-family: var(--ds-font);
    font-size: 14px;
}

.alert-success {
    background-color: var(--ds-primary-container);
    border-color: var(--ds-primary);
    color: var(--ds-on-primary-container);
}

.alert-danger {
    background-color: var(--ds-error-container);
    border-color: var(--ds-error);
    color: var(--ds-on-error-container);
}

/* =============================================
   Stock Low / OK
   ============================================= */
.stock-low {
    color: var(--ds-error);
    font-weight: 600;
}

.stock-ok {
    color: var(--ds-primary);
    font-weight: 600;
}

.stock-bar {
    height: 8px;
    border-radius: 4px;
    margin-top: 5px;
}

.stock-bar-danger { background: var(--ds-error); }
.stock-bar-warning { background: #ffc107; }
.stock-bar-success { background: var(--ds-primary); }

/* =============================================
   Dashboard
   ============================================= */
.dashboard-card {
    padding: 1.5rem;
    border-radius: var(--ds-radius-card);
    color: white;
    min-height: 120px;
}

.dashboard-card.primary {
    background: linear-gradient(135deg, var(--ds-primary), #0d1a12);
}

.dashboard-card.success {
    background: linear-gradient(135deg, #1b3022, #2a4532);
}

.dashboard-card.warning {
    background: linear-gradient(135deg, #c78800, #a06d00);
    color: white;
}

.dashboard-card.danger {
    background: linear-gradient(135deg, var(--ds-error), #7f0000);
}

.dashboard-card.info {
    background: linear-gradient(135deg, var(--ds-tertiary), #2a4a58);
    color: white;
}

/* =============================================
   Charts
   ============================================= */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* =============================================
   Login
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

/* =============================================
   Animations
   ============================================= */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Badges
   ============================================= */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--ds-radius-default);
    font-size: 12px;
}

/* =============================================
   Pagination
   ============================================= */
.pagination .page-item.active .page-link {
    background-color: var(--ds-primary);
    border-color: var(--ds-primary);
}

.pagination .page-link {
    color: var(--ds-primary);
    border-radius: var(--ds-radius-default);
}

.pagination .page-link:hover {
    color: #2a4532;
}

/* =============================================
   Dropdown Menu
   ============================================= */
.dropdown-menu {
    border-radius: var(--ds-radius-card);
    border: 1px solid var(--ds-outline-variant);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 8px;
}

.dropdown-item {
    border-radius: 6px;
    font-family: var(--ds-font);
    font-size: 14px;
    padding: 8px 12px;
}

.dropdown-item:hover {
    background-color: var(--ds-surface-container-high);
}

/* =============================================
   Modal
   ============================================= */
.modal-content {
    border-radius: var(--ds-radius-card);
    border: 1px solid var(--ds-outline-variant);
}

.modal-header {
    border-bottom: 1px solid var(--ds-outline-variant);
    border-radius: var(--ds-radius-card) var(--ds-radius-card) 0 0;
}

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

/* =============================================
   Página de Configuración (Bento Grid)
   ============================================= */
.config-page .settings-card {
    border: 1px solid var(--ds-outline-variant);
    border-radius: var(--ds-radius-card);
}

.config-page .settings-card:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.settings-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ds-on-surface-variant);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-family: var(--ds-font);
}

.settings-input {
    border-radius: var(--ds-radius-default);
    border-color: var(--ds-outline-variant);
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--ds-font);
}

.settings-input:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(27, 48, 34, 0.12);
}

/* Hero de la finca */
.farm-hero {
    height: 160px;
    background: linear-gradient(135deg, #0d1a12 0%, #1b3022 30%, #2a4532 60%, #3e6374 100%);
    position: relative;
    overflow: hidden;
}

.farm-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 30% 70%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(27,48,34,0.3) 0%, transparent 40%);
    animation: farmGlow 8s ease-in-out infinite alternate;
}

@keyframes farmGlow {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.farm-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
}

/* Avatar de perfil con upload */
.avatar-wrapper {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px dashed var(--ds-outline-variant);
    transition: all 0.2s ease;
}

.avatar-wrapper:hover {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(27, 48, 34, 0.12);
}

.avatar-wrapper:hover .avatar-upload-hint {
    opacity: 1;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.avatar-upload-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 18px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Banner hero con upload */
.farm-hero {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.farm-hero:hover {
    opacity: 0.92;
}

.farm-hero-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.farm-hero:hover .farm-hero-hint {
    opacity: 1;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .sidebar {
        left: calc(var(--sidebar-width) * -1);
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* =============================================
   Utilities
   ============================================= */
.cursor-pointer { cursor: pointer; }

.text-primary-dark { color: var(--primary-dark) !important; }
.bg-primary-dark { background-color: var(--primary-dark) !important; }
.bg-primary-gradient { background: linear-gradient(135deg, var(--ds-primary), var(--primary-dark)); }

/* Input group compatibility */
.input-group-text {
    border-radius: var(--ds-radius-default);
    border-color: var(--ds-outline-variant);
    background: var(--ds-surface-container-lowest);
}

.input-group .form-control {
    border-radius: 0 var(--ds-radius-default) var(--ds-radius-default) 0;
}

/* Footer */
footer {
    background: var(--ds-surface-container-lowest);
    border-top: 1px solid var(--ds-outline-variant);
    color: var(--ds-on-surface-variant);
}

/* =============================================
   Dashboard - Heritage Precision Bento Grid
   ============================================= */
.dashboard-hero-title {
    font: var(--ds-headline);
    color: var(--ds-primary);
    margin-bottom: 4px;
}

.dashboard-hero-sub {
    font: var(--ds-body-lg);
    color: var(--ds-on-surface-variant);
    margin-bottom: 0;
}

.dashboard-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stat-card-clickable:active {
    transform: scale(0.98);
}

.dashboard-quick-btn {
    border: 1px solid var(--ds-outline-variant);
    transition: background 0.2s;
}

.dashboard-quick-btn:hover {
    background: var(--ds-surface-container-high);
    text-decoration: none;
}

.dashboard-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-primary-container);
    color: var(--ds-primary);
    font-size: 18px;
    flex-shrink: 0;
}

.dashboard-table-row {
    transition: background 0.15s;
}

.dashboard-banner {
    height: 192px;
    background: linear-gradient(135deg, #0d1a12 0%, #1b3022 40%, #2a4532 70%, #3e6374 100%);
    border: 1px solid var(--ds-outline-variant);
    position: relative;
    overflow: hidden;
}

.dashboard-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(27,48,34,0.4) 0%, transparent 50%);
}

.dashboard-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    background: linear-gradient(to top, var(--ds-surface) 0%, transparent 100%);
    color: var(--ds-on-surface);
}

/* Progress bar override para el dark card */
.card .progress {
    border-radius: 4px;
}

.card .progress-bar {
    border-radius: 4px;
}

/* Stock alert cards (modal) */
.stock-alert-card {
    background: var(--ds-surface-container-lowest);
    border: 1px solid var(--ds-outline-variant);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.15s;
}

.stock-alert-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.stock-alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stock-alert-bar {
    width: 100%;
    height: 14px;
    background: #eae7e2;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.stock-alert-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    position: relative;
}

.stock-alert-fill::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 2px;
    bottom: 2px;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25));
    border-radius: 4px;
}

/* =============================================
   Actividades Agrícolas
   ============================================= */
.act-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-primary-container);
    color: var(--ds-primary);
    font-size: 16px;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-on-surface-variant);
    font-size: 14px;
    padding: 0;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--ds-surface-container-high);
    color: var(--ds-primary);
}

.act-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.15s;
}

.act-row:hover .act-actions {
    opacity: 1;
}

.actividades-banner-card {
    border: 1px solid var(--ds-outline-variant);
}

.actividades-table thead th {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* =============================================
   Login - Heritage Precision
   ============================================= */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card-new {
    background: var(--ds-surface-container-lowest);
    border: 1px solid var(--ds-outline-variant);
    border-radius: var(--ds-radius-card);
    padding: 40px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.login-brand-icon {
    width: 64px;
    height: 64px;
    background: var(--ds-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--ds-primary-fixed, #d0e9d4);
}

.login-brand-title {
    font: 600 24px/32px var(--ds-font);
    color: var(--ds-primary);
    margin-bottom: 4px;
}

.login-brand-sub {
    font: 400 15px/24px var(--ds-font);
    color: var(--ds-on-surface-variant);
    margin: 0;
}

.login-label {
    font: 600 13px/20px var(--ds-font);
    color: var(--ds-on-surface-variant);
    display: block;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.login-input-group {
    border-radius: var(--ds-radius-default);
    overflow: hidden;
}

.login-input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(27, 48, 34, 0.12);
    border-radius: var(--ds-radius-default);
}

.login-input-icon {
    background: var(--ds-surface-container-low);
    border: 1px solid var(--ds-outline-variant);
    border-right: none;
    color: var(--ds-outline);
    padding: 0 14px;
    font-size: 16px;
    transition: color 0.2s;
}

.login-input-group:focus-within .login-input-icon {
    color: var(--ds-primary);
    border-color: var(--ds-primary);
}

.login-input {
    border: 1px solid var(--ds-outline-variant);
    border-left: none;
    background: var(--ds-surface-container-low);
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--ds-font);
    border-radius: 0 var(--ds-radius-default) var(--ds-radius-default) 0;
}

.login-input:focus {
    border-color: var(--ds-primary);
    box-shadow: none;
}

.login-btn {
    background: var(--ds-primary);
    color: var(--ds-on-primary);
    font: 600 16px/24px var(--ds-font);
    padding: 14px 24px;
    border-radius: var(--ds-radius-default);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #2a4532;
    color: white;
}

.login-btn:active {
    transform: scale(0.98);
}

.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ds-outline-variant);
    text-align: center;
}

.login-footer-top {
    font: 600 11px/16px var(--ds-font);
    color: var(--ds-outline);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.login-footer-bottom {
    font: 400 12px/16px var(--ds-font);
    color: var(--ds-on-surface-variant);
    margin: 0;
}

.login-status-bar {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 8px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.login-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

/* =============================================
   Stock Control
   ============================================= */
.stock-table thead th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.stock-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
}

.stock-row {
    transition: background 0.15s;
}

.table-danger-subtle {
    background: #fff5f5 !important;
}

.stock-status-danger { /* util */ }
.stock-status-warning { /* util */ }
.stock-status-ok { /* util */ }

.stock-preview-img {
    height: 140px;
    background: linear-gradient(135deg, #1b3022 0%, #2a4532 50%, #3e6374 100%);
    position: relative;
}

.stock-preview-img::after {
    content: 'CENTRO DE SUMINISTROS - SECCIÓN B';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* =============================================
   Catálogo de Insumos (Card Grid)
   ============================================= */
.insumo-card {
    border: 1px solid var(--ds-outline-variant);
    border-radius: var(--ds-radius-card);
    transition: box-shadow 0.2s;
}

.insumo-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

.insumo-card-img {
    height: 160px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insumo-card-icon {
    font-size: 48px;
    color: rgba(255,255,255,0.2);
    transition: transform 0.4s;
}

.insumo-card:hover .insumo-card-icon {
    transform: scale(1.15);
}

.insumo-card-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insumo-stock-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--ds-outline-variant);
    border-bottom: 1px solid var(--ds-outline-variant);
}

/* Filter pills */
.insumo-filter-btn {
    border-radius: 100px;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--ds-outline-variant);
    color: var(--ds-on-surface-variant);
    background: transparent;
    transition: all 0.15s;
}

.insumo-filter-btn:hover {
    background: var(--ds-surface-container-high);
}

.insumo-filter-btn.active {
    background: var(--ds-primary);
    color: var(--ds-on-primary);
    border-color: var(--ds-primary);
}

/* =============================================
   Planificación - Calendar Grid
   ============================================= */
.cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--ds-primary);
    color: white;
}

.cal-header-cell {
    text-align: center;
    padding: 12px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.cal-header-muted {
    opacity: 0.65;
}

.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
    border-right: 1px solid var(--ds-outline-variant);
    border-bottom: 1px solid var(--ds-outline-variant);
    padding: 6px 8px;
    background: var(--ds-surface-container-lowest);
    min-height: 120px;
    overflow: hidden;
}

.cal-cell-prev {
    background: var(--ds-surface-container-low);
    opacity: 0.45;
}

.cal-cell-weekend {
    background: #fafaf5;
}

.cal-cell-today {
    background: rgba(208,233,212,0.3);
}

.cal-day-num {
    font-size: 13px;
    color: var(--ds-on-surface-variant);
}

.cal-day-muted {
    opacity: 0.4;
}

.cal-day-today {
    font-weight: 700;
    color: var(--ds-primary);
}

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.cal-event {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
    line-height: 1.4;
}

.cal-event:hover { opacity: 0.75; }

.active-cal {
    background: white !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 10px !important;
    font-weight: 600;
    color: var(--ds-primary);
    border: none !important;
}
