* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: #111827;
    background: #f4f6f9;
}

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

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #111827;
    color: white;
    padding: 32px 24px;
    flex-shrink: 0;
}

.brand {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 55px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
    color: white;
    text-decoration: none;
    font-size: 17px;
    padding: 14px 14px;
    border-radius: 6px;
}

.sidebar nav a:hover {
    background: #1f2937;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 80px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    font-size: 17px;
}

.topbar span {
    color: #6b7280;
}

.content {
    padding: 36px 34px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 34px;
    margin: 0 0 6px;
}

.page-header p {
    margin: 0;
    color: #6b7280;
    font-size: 17px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    padding: 26px;
    min-height: 130px;
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 14px;
}

.stat-card strong {
    font-size: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
}

.panel {
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    padding: 26px;
}

.panel h2 {
    margin: 0 0 24px;
    font-size: 22px;
}

.placeholder {
    min-height: 250px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 17px;
}

@media (max-width: 1000px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-primary {
    display: inline-block;
    background: #111827;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 7px;
    font-weight: 600;
}

.btn-primary:hover {
    background: #1f2937;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    font-size: 14px;
    color: #6b7280;
    font-weight: 600;
}

.data-table td {
    font-size: 15px;
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status.activo {
    background: #dcfce7;
    color: #166534;
}

.status.inactivo {
    background: #f3f4f6;
    color: #6b7280;
}

.form-panel {
    max-width: 1000px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
    font-size: 15px;
    color: #111827;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #111827;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

button.btn-primary {
    border: 0;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary {
    display: inline-block;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    text-decoration: none;
    padding: 11px 18px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #f9fafb;
}

@media (max-width: 750px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.action-link,
.action-button {
    border: 0;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
}

.action-link:hover,
.action-button:hover {
    text-decoration: underline;
}

.action-button.danger {
    color: #b91c1c;
}

/* Reglas Globales de Impresión / Guardado PDF */
@media print {
    .sidebar, 
    .topbar, 
    .page-header, 
    .page-header-actions, 
    .print-hide, 
    nav, 
    header, 
    footer, 
    .btn-primary, 
    .btn-secondary, 
    .table-actions {
        display: none !important;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .app, .main, .content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
    }

    a[href]:after {
        content: "" !important;
    }

    @page {
        size: letter portrait;
        margin: 10mm 12mm;
    }
}