@import url('/css/fbr-tokens.css');

/* ─── Reset/Base ─────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    color: var(--fg-1);
    background: var(--bg-2);
    line-height: var(--lh-normal);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); margin-bottom: var(--space-5); }
h3 { font-size: var(--fs-h3); margin-bottom: var(--space-3); }
h4 { font-size: var(--fs-h4); }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.app-sidebar {
    background: var(--dark);
    color: var(--fg-on-primary);
    padding: var(--space-6) var(--space-4);
    display: flex; flex-direction: column; gap: var(--space-4);
}
.app-sidebar .brand { text-align: center; margin-bottom: var(--space-6); }
.app-sidebar .brand img { width: 100px; height: auto; }
.app-sidebar .brand .name { font-family: var(--font-display); font-weight: var(--fw-bold); margin-top: var(--space-2); font-size: var(--fs-lg); }
.app-sidebar nav a {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4); color: rgba(255,255,255,.75);
    border-radius: var(--radius-sm); font-weight: var(--fw-medium);
    transition: background .2s, color .2s;
}
.app-sidebar nav a:hover, .app-sidebar nav a.active { background: rgba(255,255,255,.08); color: var(--white); }
.app-sidebar nav a.active { background: var(--gradient-primary); }
.app-main { padding: var(--space-6) var(--space-8); overflow-x: auto; }
.app-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: var(--space-5); border-bottom: 1px solid #e5e7eb; margin-bottom: var(--space-6);
}
.app-topbar h1 { font-size: var(--fs-h2); }
.user-menu { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); }
.user-menu .avatar {
    width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: var(--fw-bold);
}

/* ─── Cards / Stats ──────────────────────────────────────────────────── */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.stat-card {
    background: var(--white); border-radius: var(--radius-md);
    padding: var(--space-5); box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .label { font-size: var(--fs-sm); color: var(--fg-2); text-transform: uppercase; letter-spacing: .5px; font-weight: var(--fw-medium); margin-bottom: var(--space-2); }
.stat-card .value { font-size: 2.25rem; font-weight: var(--fw-bold); color: var(--dark); font-family: var(--font-display); }
.stat-card .meta { font-size: var(--fs-sm); color: var(--fg-2); margin-top: var(--space-2); }
.stat-card.primary { background: var(--gradient-primary); color: var(--white); }
.stat-card.primary .label, .stat-card.primary .value, .stat-card.primary .meta { color: var(--white); }

/* ─── Table ──────────────────────────────────────────────────────────── */
.card {
    background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    padding: var(--space-5); margin-bottom: var(--space-5);
}
.card h3 { margin-bottom: var(--space-4); display: flex; justify-content: space-between; align-items: center; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: var(--space-3) var(--space-4); font-weight: var(--fw-semibold); color: var(--fg-2); border-bottom: 2px solid #e5e7eb; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .5px; }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid #f3f4f6; }
.table tr:hover { background: var(--bg-2); }

/* ─── Badges ─────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .5px; }
.badge.success { background: rgba(0,200,150,.12); color: var(--success); }
.badge.warning { background: rgba(255,183,0,.12); color: var(--warning); }
.badge.danger  { background: rgba(255,51,102,.12); color: var(--danger); }
.badge.info    { background: rgba(0,180,216,.12); color: var(--secondary); }
.badge.muted   { background: #f3f4f6; color: var(--gray); }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-5); border-radius: var(--radius-pill); font-weight: var(--fw-semibold); cursor: pointer; border: none; transition: all .2s; text-decoration: none; font-size: var(--fs-sm); }
.btn-primary { background: var(--gradient-primary); color: var(--white); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--white); }
.btn-secondary { background: #f3f4f6; color: var(--fg-1); }
.btn-secondary:hover { background: #e5e7eb; }

/* ─── Auth pages ─────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg-hero);
}
.auth-card {
    background: var(--white); border-radius: var(--radius-lg);
    padding: var(--space-8); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 420px;
}
.auth-card .brand { text-align: center; margin-bottom: var(--space-6); }
.auth-card .brand img { width: 120px; }
.auth-card h2 { text-align: center; margin-bottom: var(--space-5); }
.form-group { margin-bottom: var(--space-4); }
.form-group label { display: block; font-weight: var(--fw-medium); margin-bottom: var(--space-2); font-size: var(--fs-sm); }
.form-control { width: 100%; padding: var(--space-3) var(--space-4); border: 1px solid #e5e7eb; border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-base); transition: border .2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,.1); }
.form-help { font-size: var(--fs-xs); color: var(--fg-2); margin-top: var(--space-1); }
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-size: var(--fs-sm); }
.alert-error { background: rgba(255,51,102,.08); color: var(--danger); border-left: 3px solid var(--danger); }
.alert-success { background: rgba(0,200,150,.08); color: var(--success); border-left: 3px solid var(--success); }
.alert-info { background: rgba(0,180,216,.08); color: var(--secondary); border-left: 3px solid var(--secondary); }
