:root {
    --bg-main: #f1f5f9;
    --bg-sidebar: #0f172a;
    --white: #ffffff;
    --primary: #10b981;
    --primary-dark: #059669;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --red: #ef4444;
    --blue: #3b82f6;
    --orange: #f59e0b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.nav-item.logout {
    margin-bottom: 2rem;
    color: #fca5a5;
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.nav-spacer { flex: 1; }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-header {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    width: 400px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.notification-bell {
    position: relative;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--red);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 9999px;
}

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

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

/* Body Content */
.content-body {
    padding: 2rem;
}

.page-title { margin-bottom: 2rem; }
.page-title h1 { font-size: 1.75rem; }
.page-title p { color: var(--text-muted); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: #dbeafe; color: var(--blue); }
.stat-icon.green { background: #d1fae5; color: var(--primary); }
.stat-icon.orange { background: #fef3c7; color: var(--orange); }
.stat-icon.red { background: #fee2e2; color: var(--red); }

.stat-data .label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2px; }
.stat-data .value { font-size: 1.5rem; font-weight: 700; }

.alert-active { border: 2px solid var(--red); animation: pulse-border 2s infinite; }
@keyframes pulse-border {
    0% { border-color: var(--red); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { border-color: transparent; box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { border-color: var(--red); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Dashboard Grid */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.panel {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-primary.small {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Table */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--bg-main);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-main);
    font-size: 0.9rem;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.ingreso { background: #d1fae5; color: var(--primary-dark); }
.status-pill.retiro { background: #fef3c7; color: #b45309; }
.status-pill.salida { background: #f3f4f6; color: #374151; }

/* Side Panels */
.side-panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scan-panel { background: var(--bg-sidebar); color: var(--white); }
.scan-panel h3 { margin-bottom: 1rem; font-size: 1rem; }
.scan-input-wrapper {
    background: rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.scan-input-wrapper input {
    background: transparent;
    border: none;
    color: var(--white);
    outline: none;
}
.helper-text { font-size: 0.75rem; color: #94a3b8; }

.alarm-panel h3 { margin-bottom: 1rem; font-size: 1rem; color: var(--red); display: flex; align-items: center; gap: 0.5rem; }
.alarm-placeholder { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 1rem 0; }

.active-alarm-item {
    background: #fee2e2;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--red);
}

.active-alarm-item h4 { color: var(--red); font-size: 0.9rem; margin-bottom: 5px; }
.active-alarm-item p { font-size: 0.8rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    width: 500px;
    border-radius: 1.5rem;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    background: var(--red);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}
.modal-header i { font-size: 3rem; margin-bottom: 1rem; }

.modal-body { padding: 2rem; }
.alert-info { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.alert-info img { width: 60px; height: 60px; border-radius: 10px; }
.alert-info h3 { color: var(--red); margin-bottom: 4px; }
.alert-reason { font-size: 0.9rem; font-weight: 600; color: #374151; }

.alert-details {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
}
.alert-details p { margin-bottom: 8px; }

.modal-footer { padding: 1rem 2rem 2rem; }
.btn-danger {
    width: 100%;
    padding: 1rem;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

