/* RAKJO ZIP Service - Estilos base */

:root {
    --color-primary: #1a3a5c;
    --color-primary-light: #2d5a8c;
    --color-accent: #c9a84c;
    --color-danger: #d32f2f;
    --color-success: #4CAF50;
    --color-background: #f5f7fa;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #ddd;
    --color-white: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background-color: #f9f9f9;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
button, input[type="submit"], input[type="button"] {
    font-family: inherit;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forms */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-background);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-light); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Select Styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a3a5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 35px;
}

/* Range Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--color-background);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in { animation: fadeIn 0.3s ease-in-out; }
.slide-in { animation: slideIn 0.3s ease-in-out; }

/* Print Styles */
@media print {
    .no-print { display: none; }
    body { background: white; }
}

/* ═════════════════════════════════════════════════════════════════
   LAYOUT ESTÁNDAR RAIE — Sidebar + Main
   ═════════════════════════════════════════════════════════════════ */

html, body { overflow: hidden; height: 100%; }

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 200;
    transition: transform .3s;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.logo-mark {
    background: var(--color-accent);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: .5px;
    white-space: nowrap;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    opacity: .7;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: block;
    padding: 9px 16px;
    font-size: 13px;
    color: rgba(255,255,255,.75) !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 6px;
    margin: 0 8px;
    transition: background .2s, color .2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.nav-active {
    background: rgba(255,255,255,.12);
    color: #fff !important;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    padding: 10px 16px 4px;
    margin: 0 8px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 6px 10px;
}

.sidebar-lang select {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    outline: none;
}

.sidebar-lang select option { background: var(--color-primary); color: #fff; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.user-info strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.user-info small {
    font-size: 10px;
    opacity: .65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.btn-sidebar-icon {
    color: rgba(255,255,255,.6) !important;
    font-size: 18px;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    transition: color .2s;
}

.btn-sidebar-icon:hover { color: #fff !important; }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--color-background);
}

.main-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 56px;
    min-height: 56px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    z-index: 100;
}

.main-topbar h1 {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#btn-help {
    background: none !important;
    border: 1px solid rgba(26,58,92,.3) !important;
    color: var(--color-primary) !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

#btn-help:hover { background: rgba(26,58,92,.08) !important; }

.content-scroll {
    flex: 1;
    overflow-y: auto;
}

.hamburger-btn {
    background: none !important;
    border: none !important;
    font-size: 22px !important;
    cursor: pointer !important;
    color: var(--color-primary) !important;
    padding: 4px !important;
    flex-shrink: 0 !important;
}

.hide-desktop { display: none; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        z-index: 300;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .hide-desktop { display: flex; }
    .content-grid { grid-template-columns: 1fr !important; padding: 15px; }
}
