/* Custom App layout — sidebar nav + content area */

/* ===== APP FRAME OVERRIDE ===== */
.custom-app-frame {
    display: flex !important;
    flex-direction: row !important;
    background: #f0f2f5;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
    width: 200px;
    min-width: 200px;
    background: #124559;
    display: flex;
    flex-direction: column;
    color: white;
    font-family: 'Inter', sans-serif;
}
.app-sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.app-sidebar-logo {
    max-width: 110px;
    height: auto;
    filter: brightness(0) invert(1);
}
.app-sidebar-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.85;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Nav items */
.app-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
}
.app-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.app-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.app-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.app-nav-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: #f0a500;
    font-weight: 600;
}

/* Sidebar footer */
.app-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    line-height: 1.5;
}
.app-sidebar-dev {
    margin-bottom: 4px;
}
.app-sidebar-update {
    font-size: 0.55rem;
}

/* ===== CONTENT AREA ===== */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Header bar */
.app-header {
    height: 48px;
    min-height: 48px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
.app-page-title {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}
.app-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.app-header-company {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #666;
}
.app-header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e8ecf1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-header-avatar svg {
    width: 18px;
    height: 18px;
    stroke: #666;
}

/* ===== PAGES ===== */
.app-page {
    display: none;
    flex: 1;
    flex-direction: column;
    padding: 16px 20px;
    overflow: auto;
    gap: 14px;
}
.app-page.active {
    display: flex;
}

/* ===== KPI STRIP ===== */
.app-kpi-strip {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}
.app-kpi {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 3px solid #124559;
}
.app-kpi.kpi-yellow { border-left-color: #f1c40f; }
.app-kpi.kpi-blue   { border-left-color: #3498db; }
.app-kpi.kpi-green  { border-left-color: #27ae60; }
.app-kpi-val {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}
.app-kpi-lbl {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ===== CARDS ===== */
.app-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.app-card-header {
    padding: 14px 20px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.app-card-header.compact {
    padding: 10px 16px 6px;
}
.app-card-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}
.app-card-subtitle {
    font-size: 0.72rem;
    color: #888;
}
.app-card-body {
    padding: 6px 20px 18px;
}

/* ===== CHARTS GRID ===== */
.app-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.app-chart-card {
    display: flex;
    flex-direction: column;
}
.app-chart-card .app-card-body {
    flex: 1;
    min-height: 0;
    padding: 4px 14px 12px;
    position: relative;
}
.app-chart-card canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ===== TABLE ===== */
.app-table {
    width: 100%;
    font-size: 0.72rem;
}
.app-table th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}
.app-table-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Small inline filters */
.form-select-sm,
.form-input-sm {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    color: #555;
    background: #fafafa;
}
.form-input-sm {
    width: 120px;
}

/* ===== FORM ELEMENTS ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #323232;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    background: white;
    color: #333;
    transition: border-color 0.2s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #124559;
    outline: none;
    box-shadow: 0 0 0 3px rgba(18,69,89,0.1);
}
.form-textarea {
    resize: vertical;
    min-height: 48px;
}

/* Action buttons */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}
.btn-save {
    padding: 10px 24px;
    background: #124559;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-save:hover { background: #0d3344; }
.btn-cancel {
    padding: 10px 24px;
    background: white;
    color: #666;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-cancel:hover { background: #f5f5f5; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}
.status-pendiente {
    background: #fff3cd;
    color: #856404;
}
.status-proceso {
    background: #d6eaf8;
    color: #1a5276;
}
.status-entregado {
    background: #d4edda;
    color: #155724;
}
