/* assets/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:       #1a3c5e;
    --brand-light: #2d6ca2;
    --brand-pale:  #e8f0f8;
    --accent:      #c8a96e;
    --text:        #1e2a38;
    --text-muted:  #5a6a7a;
    --border:      #d4dde6;
    --bg:          #f4f7fa;
    --white:       #ffffff;
    --danger:      #c0392b;
    --success:     #1e7e4a;
    --radius:      10px;
    --shadow:      0 2px 12px rgba(26,60,94,.10);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── LOGIN ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
}
.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
}
.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-card .logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: -.3px;
}
.login-card .logo p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    transition: border-color .2s;
    outline: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--brand-light);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .88; }
.btn-primary  { background: var(--brand); color: var(--white); }
.btn-accent   { background: var(--accent); color: var(--white); }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-danger   { background: var(--danger); color: var(--white); }
.btn-success  { background: var(--success); color: var(--white); }
.btn-full     { width: 100%; justify-content: center; padding: 13px; font-size: 16px; }
.btn-sm       { padding: 6px 12px; font-size: 13px; }

/* ── LAYOUT ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--brand);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 0;
}
.sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-logo h2 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.sidebar-logo span { font-size: 12px; opacity: .6; }

.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,.12);
    color: var(--white);
}
.sidebar-nav .nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: rgba(255,255,255,.35);
    padding: 16px 24px 6px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: 13px;
}
.sidebar-footer .user-name { font-weight: 600; color: var(--white); }
.sidebar-footer .user-role {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.sidebar-footer a { color: rgba(255,255,255,.5); font-size: 12px; text-decoration: none; }
.sidebar-footer a:hover { color: var(--white); }

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 36px 40px;
}

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--brand); }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ── ROLE BADGE ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-master    { background: #fde8d8; color: #8b3a10; }
.badge-agencia   { background: #d8ede4; color: #1a5c38; }
.badge-consultor { background: #ddeaf8; color: #1a3c6e; }

/* ── SIMULATORS GRID ── */
.simulators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 8px;
}
.sim-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .2s, box-shadow .2s;
    cursor: pointer;
}
.sim-card:hover {
    border-color: var(--brand-light);
    box-shadow: var(--shadow);
}
.sim-card-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-pale);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.sim-card h3 { font-size: 15px; font-weight: 600; color: var(--brand); }
.sim-card p  { font-size: 13px; color: var(--text-muted); }
.sim-card .sim-type {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: auto;
}

/* ── TABLES ── */
.table-wrap {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--brand-pale);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 12px 16px;
    text-align: left;
}
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: var(--bg); }
tbody td { padding: 12px 16px; font-size: 14px; }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-error   { background: #fde8e8; color: var(--danger); border: 1px solid #f5c0c0; }
.alert-success { background: #e0f4ea; color: var(--success); border: 1px solid #a8dfc0; }

/* ── CARD ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 28px;
    margin-bottom: 24px;
}
.card h2 { font-size: 17px; font-weight: 700; color: var(--brand); margin-bottom: 20px; }

/* ── MODAL ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--white);
    border-radius: 14px;
    padding: 36px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.modal h2 { font-size: 18px; font-weight: 700; color: var(--brand); margin-bottom: 24px; }

/* ── IFRAME SIMULADOR ── */
.sim-frame-wrap {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
}
.sim-frame-bar {
    background: var(--brand);
    color: var(--white);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}
.sim-frame-bar a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px; }
.sim-frame-bar a:hover { color: var(--white); }
iframe.sim-iframe {
    width: 100%;
    height: calc(100vh - 130px);
    border: none;
    display: block;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 20px; }
}
