/* ============================================================================
   ORI Tech Group — Gestor de Suscripciones
   Tema basado en la identidad de marca ORI (azul marino + azul brillante + verde)
   ============================================================================ */
:root {
    --navy:      #052f5b;   /* azul marino profundo */
    --navy-dark: #041b3d;   /* navy casi negro */
    --blue:      #087dd1;   /* azul principal */
    --blue-2:    #149be9;   /* azul claro del degradado */
    --cyan:      #4bc5ff;   /* cian de acento */
    --green:     #24a75f;   /* verde marca */
    --green-2:   #39cf83;   /* verde claro */
    --primary:   var(--navy);
    --accent:    var(--blue);
    --bg:        #e8f0f6;
    --surface:   #ffffff;
    --border:    #dbeafa;
    --text:      #0a2a4a;
    --muted:     #5d6e7e;
    --ok:        #1a8f5a;
    --warn:      #c8880a;
    --danger:    #c0392b;
    --radius:    10px;
    --shadow:    0 1px 3px rgba(6, 40, 79, 0.10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
    color: #d9e8f5;
    display: flex;
    flex-direction: column;
    padding: 18px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 2px 0 12px rgba(4, 27, 61, 0.25);
}
.brand {
    background: #ffffff;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 18px 14px;
    margin-bottom: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.brand-logo { max-width: 208px; max-height: 70px; object-fit: contain; display: block; }
.brand-tag { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--navy); font-weight: 700; text-align: center; }

.sidebar nav { display: flex; flex-direction: column; margin-top: 12px; }
.sidebar nav a {
    color: #c3d6e8; padding: 11px 22px; text-decoration: none;
    border-left: 3px solid transparent; transition: 0.15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: rgba(20,155,233,0.16); color: #fff; border-left-color: var(--blue-2); }

.sidebar-footer { margin-top: auto; padding: 10px 20px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-footer a { color: #c3d6e8; text-decoration: none; font-size: 13px; }
.sidebar-footer a.logout { color: #ffb4a9; }
.user-chip { color: #8fb0c9; font-size: 12px; margin-top: 4px; }

.content { flex: 1; padding: 28px 34px; max-width: 1200px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; color: var(--navy); }
.page-tools { display: flex; gap: 8px; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.card.narrow { max-width: 520px; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; color: var(--navy); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow);
}
.stat-num { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat.warn .stat-num { color: var(--warn); }
.stat.info .stat-num { color: var(--blue); }
.stat.danger .stat-num { color: var(--danger); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Buttons */
.btn {
    display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none;
    transition: 0.15s; font-weight: 600;
}
.btn:hover { background: #f0f6fb; text-decoration: none; }
.btn.primary { background: linear-gradient(100deg, var(--blue), var(--blue-2)); border: none; color: #fff; box-shadow: 0 6px 18px rgba(8,125,209,0.28); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger-outline { color: var(--danger); border-color: #f0c4be; }
.btn.danger-outline:hover { background: #fdf0ee; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 13px; font-weight: 600; color: var(--navy); display: flex; flex-direction: column; gap: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,125,209,0.12); }
textarea { resize: vertical; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end form { margin: 0; }

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-form input[type=text] { max-width: 240px; }
.filter-form select { width: auto; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.inline-form input { max-width: 280px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.check input { width: auto; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table tr:hover td { background: #f6fbfe; }
.table.small { font-size: 13px; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }

/* Badges and tags */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; background: #eef3f8; color: var(--muted); }
.badge.ok { background: #e4f5ec; color: var(--ok); }
.badge.warn { background: #fdf3df; color: var(--warn); }
.badge.danger { background: #fbe9e7; color: var(--danger); }
.badge.muted { background: #eef3f8; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; margin: 1px; border-radius: 6px; background: #e6f2fb; color: var(--blue); font-size: 12px; }

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

/* Flash */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 10px; font-weight: 600; }
.flash.success { background: #e4f5ec; color: var(--ok); }
.flash.error { background: #fbe9e7; color: var(--danger); }
.flash.info { background: #e6f2fb; color: var(--blue); }

/* Licencias / Usuarios */
.stat-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.license-row {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.license-form { display: flex; gap: 8px; align-items: center; flex: 1; flex-wrap: wrap; }
.license-form input { flex: 1 1 120px; min-width: 110px; padding: 8px 10px; }
.license-form .btn { flex: 0 0 auto; }

/* Login */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 20%, #0a4a86 0%, var(--navy) 55%, var(--navy-dark) 100%);
    padding: 20px;
}
.login-card {
    background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 400px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.28); text-align: center;
}
.login-logo { max-width: 240px; max-height: 120px; object-fit: contain; margin: 0 auto 6px; display: block; }
.login-title { font-size: 20px; margin: 6px 0 2px; color: var(--navy); font-weight: 800; }
.login-sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.lang-switch { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.lang-switch select { width: auto; font-size: 12px; padding: 6px 8px; }

/* Pestañas (tabs) */
.nav-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
    padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 13px;
    background: #eef3f8; color: var(--muted); border: 1px solid var(--border);
}
.tab:hover { background: #e6f2fb; color: var(--blue); text-decoration: none; }
.tab.active { background: linear-gradient(100deg, var(--blue), var(--blue-2)); color: #fff; border-color: transparent; }

@media (max-width: 800px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .content { padding: 20px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
