/* ============================================================
   GESTIONALE GREST — A.S.D. A.L.Ba 2015
   Foglio di stile comune — Tema Proposta C con icone
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

/* ---- Variabili colore ---- */
:root {
    --navy:       #0d1142;
    --navy-light: #1a1a6e;
    --gold:       #f5c518;
    --gold-dark:  #c9a010;
    --bg-page:    #f7f8fb;
    --bg-card:    #ffffff;
    --bg-sidebar: #ffffff;
    --border:     #eeeeee;
    --text-main:  #0d1142;
    --text-muted: #888888;
    --text-light: #bbbbbb;
    --danger:     #e74c3c;
    --success:    #27ae60;
    --warning-bg: #fffbe6;
    --warning-br: #f5c518;
    --warning-tx: #7a5c00;
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Barlow', sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ============================================================
   LAYOUT PRINCIPALE con sidebar
   ============================================================ */
.g-topbar {
    background: var(--navy);
    height: 5px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}

.g-header {
    position: fixed;
    top: 5px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    z-index: 99;
}

.g-logo {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--navy);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.g-logo-inner {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--gold);
}

.g-header-titles { flex: 1; }
.g-header-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px; font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}
.g-header-sub {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.g-header-user {
    display: flex; align-items: center; gap: 10px;
    margin-left: auto;
}
.g-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.g-username { font-size: 12px; font-weight: 600; color: var(--navy); }
.g-role-badge {
    background: var(--navy);
    color: white;
    font-size: 10px; font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}
.g-logout {
    font-size: 11px; font-weight: 600;
    color: var(--danger);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid var(--danger);
    transition: all 0.15s;
}
.g-logout:hover { background: var(--danger); color: white; }

/* ---- Sidebar ---- */
.g-sidebar {
    position: fixed;
    top: 63px; left: 0; bottom: 0;
    width: 200px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 98;
    padding: 10px 0;
}

.g-nav-section {
    font-size: 9px; font-weight: 700;
    color: var(--text-light);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 16px 4px;
}

.g-nav-item {
    display: flex; align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--text-muted);
    font-size: 12px; font-weight: 500;
    text-decoration: none;
    border-radius: 0 8px 8px 0;
    margin-right: 10px;
    position: relative;
    transition: all 0.15s;
    cursor: pointer;
}
.g-nav-item:hover { background: #f5f6fb; color: var(--navy); }
.g-nav-item.active {
    background: #f0f1fa;
    color: var(--navy);
    font-weight: 700;
}
.g-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}
.g-nav-icon { font-size: 15px; width: 20px; text-align: center; }
.g-nav-hr { border: none; border-top: 1px solid #f0f0f0; margin: 6px 14px; }

/* ---- Contenuto principale ---- */
.g-main {
    margin-left: 200px;
    margin-top: 63px;
    padding: 24px;
    min-height: calc(100vh - 63px);
}

/* ============================================================
   PAGINE SENZA SIDEBAR (login, cambia password)
   ============================================================ */
.g-center-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-page);
}
.g-login-card {
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border);
    width: 360px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(13,17,66,0.08);
}
.g-login-top {
    background: var(--navy);
    padding: 28px 28px 20px;
    text-align: center;
}
.g-login-logo {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--gold);
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px; font-weight: 700;
    color: var(--navy);
}
.g-login-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px; font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.g-login-sub { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 3px; }
.g-login-body { padding: 24px 28px 28px; }

/* ============================================================
   COMPONENTI COMUNI
   ============================================================ */

/* Titolo pagina */
.g-page-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px; font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}

/* Breadcrumb back */
.g-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    margin-bottom: 16px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.g-back:hover { opacity: 1; }

/* Card generica */
.g-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 18px;
}
.g-card-title {
    font-size: 13px; font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}

/* Metric cards */
.g-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.g-metric {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 14px;
}
.g-metric-accent { height: 3px; border-radius: 3px; background: var(--navy); margin-bottom: 10px; width: 28px; }
.g-metric-accent.gold { background: var(--gold); }
.g-metric-icon { font-size: 20px; margin-bottom: 4px; }
.g-metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.g-metric-val { font-size: 20px; font-weight: 700; color: var(--navy); }

/* Alert / avviso */
.g-alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.g-alert.warning { background: var(--warning-bg); border: 1px solid var(--warning-br); color: var(--warning-tx); }
.g-alert.success { background: #eafaf1; border: 1px solid #27ae60; color: #1a6b40; }
.g-alert.danger  { background: #fdf0ef; border: 1px solid #e74c3c; color: #922b21; }
.g-alert.info    { background: #eef2ff; border: 1px solid #1a1a6e; color: #1a1a6e; }

/* Tabella */
.g-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.g-table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.g-table th { background: var(--navy); color: white; padding: 11px 13px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.g-table td { padding: 10px 13px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.g-table tr:last-child td { border-bottom: none; }
.g-table tr:hover td { background: #f9f9ff; }

/* Bottoni */
.g-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border-radius: 7px;
    font-family: 'Barlow', sans-serif;
    font-size: 12px; font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.g-btn-primary  { background: var(--navy); color: white; }
.g-btn-primary:hover { background: var(--navy-light); }
.g-btn-gold     { background: var(--gold); color: var(--navy); }
.g-btn-gold:hover { background: var(--gold-dark); }
.g-btn-success  { background: var(--success); color: white; }
.g-btn-danger   { background: var(--danger); color: white; }
.g-btn-outline  { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.g-btn-outline:hover { background: var(--navy); color: white; }
.g-btn-sm { padding: 5px 10px; font-size: 11px; }
.g-btn-lg { padding: 12px 28px; font-size: 14px; width: 100%; justify-content: center; }

/* Form */
.g-form-group { margin-bottom: 14px; }
.g-label { display: block; font-size: 11px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.g-input, .g-select, .g-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    color: var(--navy);
    background: white;
    transition: border 0.15s;
    appearance: none;
}
.g-input:focus, .g-select:focus, .g-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(13,17,66,0.08);
}
.g-textarea { resize: vertical; min-height: 70px; }

/* Badge ruolo */
.g-badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.g-badge-admin       { background: var(--navy); color: white; }
.g-badge-responsabile { background: #1a6b8e; color: white; }
.g-badge-animatore   { background: #27ae60; color: white; }
.g-badge-aiuto       { background: #8e44ad; color: white; }

/* Status presenze */
.g-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.g-status-dentro   { background: #eafaf1; color: #1a6b40; }
.g-status-assente  { background: #fdf0ef; color: #922b21; }
.g-status-uscito   { background: #f5f5f5; color: #666; }
.g-status-missione { background: #f5eeff; color: #5b2d8e; }

/* Zona pericolosa GDPR */
.g-danger-zone { border: 2px solid var(--danger); border-radius: 10px; padding: 16px; background: #fff8f8; margin-top: 16px; }
.g-danger-zone-title { font-size: 12px; font-weight: 700; color: var(--danger); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Nota GDPR */
.g-nota-gdpr { background: #fff3cd; border: 1px solid #ffc107; padding: 10px 14px; border-radius: 7px; font-size: 12px; color: #856404; margin-bottom: 14px; }

/* Quick actions pills */
.g-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.g-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px; font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: 'Barlow', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.15s;
}
.g-pill-primary { background: var(--navy); color: white; }
.g-pill-primary:hover { background: var(--navy-light); }
.g-pill-gold    { background: var(--gold); color: var(--navy); }
.g-pill-gold:hover { background: var(--gold-dark); }
.g-pill-outline { background: white; color: var(--navy); border: 1px solid var(--navy); }
