/* =====================================================
   Cotizaciones — Turpial TS
   site.css
   ===================================================== */

:root {
    --primary:    #1a56db;
    --primary-dk: #1341a8;
    --secondary:  #6b7280;
    --success:    #0e9f6e;
    --danger:     #e02424;
    --warning:    #c27803;
    --bg:         #f9fafb;
    --surface:    #ffffff;
    --border:     #e5e7eb;
    --text:       #111827;
    --text-muted: #6b7280;
    --nav-bg:     #1e2939;
    --nav-text:   #e5e7eb;
    --radius:     6px;
    --shadow:     0 1px 3px rgba(0,0,0,.1);
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ---- NAVBAR ---- */
.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 0 1.5rem;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.navbar-brand a {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    letter-spacing: .5px;
}
.navbar-menu {
    display: flex;
    list-style: none;
    gap: .25rem;
    flex: 1;
    margin-left: 1rem;
}
.navbar-menu li a,
.navbar-menu li span {
    display: block;
    padding: .35rem .75rem;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
}
.navbar-menu li a:hover,
.navbar-menu li span:hover { background: rgba(255,255,255,.1); }
.navbar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 13px;
}
.badge-rol {
    background: rgba(255,255,255,.15);
    padding: .15rem .5rem;
    border-radius: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.btn-logout {
    color: #fca5a5;
    text-decoration: none;
    font-size: 13px;
}
.btn-logout:hover { color: #f87171; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--nav-bg);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    list-style: none;
    padding: .25rem 0;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { padding: .45rem 1rem; font-size: 13px; }

/* ---- MAIN ---- */
.main-content {
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.page-header h2 { font-size: 20px; font-weight: 600; }

/* ---- CARDS STAT ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.card-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.card-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.card-stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }

/* ---- TABLE ---- */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table thead th {
    background: #f3f4f6;
    padding: .65rem 1rem;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.table tbody td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f9fafb; }

/* ---- BADGES ---- */
.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.badge-rol     { background: #dbeafe; color: #1e40af; }
.badge-activo  { background: #d1fae5; color: #065f46; }
.badge-inactivo{ background: #fee2e2; color: #991b1b; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem 1rem;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm        { padding: .25rem .6rem; font-size: 12px; }
.btn-block     { width: 100%; justify-content: center; }

/* ---- FORMS ---- */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    max-width: 520px;
    box-shadow: var(--shadow);
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: .35rem;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}
.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
}

/* ---- ALERTS ---- */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 13px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.text-danger { color: var(--danger); font-size: 12px; }
.text-muted  { color: var(--text-muted); font-size: 12px; }

/* ---- LOGIN ---- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e2939;
}
.login-container { width: 100%; max-width: 380px; padding: 1rem; }
.login-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}
.login-header h1 { font-size: 22px; font-weight: 700; color: var(--primary); }
.login-header p  { font-size: 13px; color: var(--text-muted); margin-top: .2rem; }

/* ---- FOOTER ---- */
.footer {
    text-align: center;
    padding: 1rem;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
