/* ============================================
   DTMSEG - Enterprise Design System
   Visual limpo, profissional, sem cara de IA
   ============================================ */

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

:root {
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Paleta neutra profissional */
    --slate-900: #0f1419;
    --slate-800: #1a1f26;
    --slate-700: #2a3038;
    --slate-600: #3d444d;
    --slate-500: #57606a;
    --slate-400: #768390;
    --slate-300: #9ea7b3;
    --slate-200: #d1d5db;
    --slate-100: #eaedf0;
    --slate-50: #f6f8fa;
    --white: #ffffff;

    /* Accent - verde teal profissional */
    --accent: #1a7f64;
    --accent-hover: #15684f;
    --accent-light: #ddf4ec;
    --accent-text: #0d5a42;

    /* Status */
    --green: #1a7f37;
    --green-bg: #dafbe1;
    --green-border: #82e596;
    --yellow: #9a6700;
    --yellow-bg: #fff8c5;
    --yellow-border: #eac54f;
    --red: #cf222e;
    --red-bg: #ffebe9;
    --red-border: #ff8182;
    --blue: #0969da;
    --blue-bg: #ddf4ff;
    --blue-border: #80ccff;
    --purple: #8250df;
    --purple-bg: #fbefff;

    /* Layout */
    --sidebar-w: 260px;
    --header-h: 56px;
    --bg: #f6f8fa;
    --card-bg: #ffffff;
    --border-color: #d1d5db;
    --border-light: #eaedf0;
    --text-primary: #1a1f26;
    --text-secondary: #57606a;
    --text-muted: #768390;

    --radius: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 3px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: 150ms ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration:none; color:inherit; }

/* ============================================
   LOGIN
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-50);
}

.login-container {
    display: flex;
    width: 900px;
    min-height: 520px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-sidebar {
    width: 340px;
    background: var(--slate-800);
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-sidebar .brand {
    margin-bottom: 48px;
}

.login-sidebar .brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.3px;
}

.login-sidebar .brand p {
    font-size: 12px;
    color: var(--slate-400);
    margin-top: 4px;
}

.login-features {
    list-style: none;
    flex: 1;
}

.login-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    color: var(--slate-300);
    font-size: 13px;
    line-height: 1.4;
}

.login-features li .ico {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    color: var(--slate-300);
}

.login-footer-text {
    font-size: 11px;
    color: var(--slate-500);
    border-top: 1px solid var(--slate-700);
    padding-top: 16px;
}

.login-form-side {
    flex: 1;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-side h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-form-side .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border var(--transition);
}

.field input:focus, .field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26,127,100,0.1);
}

.field input::placeholder { color: var(--slate-300); }

.field-row { display:flex; gap:12px; }
.field-row .field { flex:1; }

.check-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 12px;
}

.check-row label { display:flex; align-items:center; gap:6px; color:var(--text-secondary); cursor:pointer; }
.check-row label input { accent-color: var(--accent); }
.check-row a { color:var(--accent); font-weight:500; }

.btn-login {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-login:hover { background: var(--accent-hover); }

.demo-links {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.demo-links p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.demo-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    transition: all var(--transition);
}

.demo-links a:hover {
    background: var(--slate-50);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.demo-links a i { width:16px; text-align:center; }

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

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sb-header {
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--border-light);
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sb-brand .icon {
    width: 32px;
    height: 32px;
    background: var(--slate-800);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
}

.sb-brand .text {
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-800);
}

.sb-brand .text small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: -1px;
}

.sb-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius:10px; }

.sb-section { margin-bottom: 20px; }

.sb-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 4px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 1px;
}

.sb-item i { width:18px; text-align:center; font-size:13px; }

.sb-item:hover {
    background: var(--slate-50);
    color: var(--text-primary);
}

.sb-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sb-item.active i {
    color: var(--accent);
}

.sb-count {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.sb-count.red { background: var(--red-bg); color: var(--red); }
.sb-count.yellow { background: var(--yellow-bg); color: var(--yellow); }
.sb-count.blue { background: var(--slate-100); color: var(--text-secondary); }

.sb-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
}

.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.sb-user:hover { background: var(--slate-50); }

.sb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--slate-100);
    flex-shrink: 0;
}

.sb-user-info { flex:1; min-width:0; }
.sb-user-info .name { color: var(--text-primary); font-size: 12px; font-weight: 600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-user-info .role { color: var(--text-muted); font-size: 11px; }

/* MAIN */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

/* HEADER */
.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display:flex; align-items:center; gap:16px; }

.topbar-left h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--accent); }
.breadcrumb .sep { font-size: 9px; opacity: 0.5; }

.topbar-right { display:flex; align-items:center; gap:6px; }

.search-box {
    position: relative;
    margin-right: 8px;
}

.search-box input {
    width: 220px;
    padding: 7px 12px 7px 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--slate-50);
    outline: none;
    transition: all var(--transition);
}

.search-box input:focus {
    border-color: var(--accent);
    background: var(--white);
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-300);
    font-size: 12px;
}

.topbar-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--slate-50);
    color: var(--text-primary);
}

.topbar-btn .dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.filial-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-light);
    border: 1px solid rgba(26,127,100,0.2);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-text);
    margin-right: 8px;
    transition: all var(--transition);
}

.filial-select:hover { background: rgba(26,127,100,0.15); }
.filial-select i { font-size: 11px; }

/* ============================================
   PAGE CONTENT
   ============================================ */
.page { padding: 20px 24px; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* METRIC CARDS */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.accent { background: var(--accent-light); color: var(--accent); }

.stat-val {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.stat-change {
    font-size: 11px;
    font-weight: 500;
}

.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* CARDS */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-head h3 {
    font-size: 13px;
    font-weight: 600;
}

.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

/* GRID */
.row { display:grid; gap:12px; margin-bottom:12px; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: 1fr 1fr 1fr; }
.row.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.span-full { grid-column: 1 / -1; }

/* TABLES */
.tbl {
    width: 100%;
    border-collapse: collapse;
}

.tbl th {
    text-align: left;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--slate-50);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.tbl td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover { background: var(--slate-50); }
.tbl tbody tr:last-child td { border-bottom: none; }

.tbl .row-alert { background: rgba(207,34,46,0.02); }
.tbl .row-alert:hover { background: rgba(207,34,46,0.04); }

/* CELL HELPERS */
.cell-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.avatar.v1 { background: #5a67d8; }
.avatar.v2 { background: #d69e2e; }
.avatar.v3 { background: #38a169; }
.avatar.v4 { background: #e53e3e; }
.avatar.v5 { background: #805ad5; }
.avatar.v6 { background: #2b6cb0; }
.avatar.v7 { background: #b7791f; }

.cell-main { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--text-muted); }

.cell-docs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 12px;
}

.cell-docs.ok { color: var(--green); }
.cell-docs.warn { color: var(--yellow); }
.cell-docs.fail { color: var(--red); }

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge.green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge.blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.badge.purple { background: var(--purple-bg); color: var(--purple); border-color: rgba(130,80,223,0.3); }
.badge.neutral { background: var(--slate-100); color: var(--slate-500); border-color: var(--border-color); }

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dot.green { background: var(--green); }
.badge-dot.yellow { background: var(--yellow); }
.badge-dot.red { background: var(--red); }
.badge-dot.blue { background: var(--blue); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
    background: var(--white);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover { background: var(--slate-50); color: var(--text-primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 6px 8px;
}

.btn-ghost:hover { background: var(--slate-100); color: var(--text-primary); }

.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #15703e; }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #b01c28; }

.btn-sm { padding: 5px 10px; font-size: 11px; }

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--slate-50);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-group { display:flex; gap:6px; }

/* TABS */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 18px;
}

.tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
    margin-bottom: -1px;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.tab .cnt {
    margin-left: 4px;
    font-size: 11px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--slate-100);
    color: var(--text-muted);
}

.tab.active .cnt {
    background: var(--accent-light);
    color: var(--accent);
}

/* PROGRESS BAR */
.progress {
    width: 100%;
    height: 5px;
    background: var(--slate-100);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
}

.progress-bar.green { background: var(--green); }
.progress-bar.yellow { background: var(--yellow); }
.progress-bar.red { background: var(--red); }
.progress-bar.blue { background: var(--blue); }

/* TIMELINE */
.timeline {}

.tl-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.tl-item:last-child { border-bottom: none; }

.tl-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.tl-dot.green { background: var(--green); }
.tl-dot.blue { background: var(--blue); }
.tl-dot.red { background: var(--red); }
.tl-dot.yellow { background: var(--yellow); }

.tl-text { flex:1; color: var(--text-primary); }
.tl-text strong { font-weight: 600; }
.tl-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* DOC CARDS */
.doc-list { display: flex; flex-direction: column; gap: 8px; }

.doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.doc-row:hover {
    background: var(--slate-50);
    border-color: var(--border-color);
}

.doc-ico {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.doc-ico.green { background: var(--green-bg); color: var(--green); }
.doc-ico.yellow { background: var(--yellow-bg); color: var(--yellow); }
.doc-ico.red { background: var(--red-bg); color: var(--red); }
.doc-ico.blue { background: var(--blue-bg); color: var(--blue); }
.doc-ico.neutral { background: var(--slate-100); color: var(--slate-400); }

.doc-info { flex:1; }
.doc-info .name { font-weight: 600; font-size: 13px; }
.doc-info .meta { font-size: 11px; color: var(--text-muted); }

/* UPLOAD AREA */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--slate-50);
}

.upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-zone i { font-size: 28px; color: var(--slate-300); margin-bottom: 10px; display:block; }
.upload-zone h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { font-size: 12px; color: var(--text-muted); }

/* ALERT BANNER */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-banner.red {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
}

.alert-banner.yellow {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
}

.alert-banner.blue {
    background: var(--blue-bg);
    border: 1px solid var(--blue-border);
    color: var(--blue);
}

.alert-banner i { font-size: 16px; flex-shrink: 0; }
.alert-banner .text { flex:1; }
.alert-banner strong { font-weight: 600; }

/* PROFILE HEADER */
.profile-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.profile-info { flex:1; }
.profile-info h2 { font-size: 16px; font-weight: 700; display:flex; align-items:center; gap:8px; }
.profile-meta { display:flex; gap:16px; font-size: 12px; color: var(--text-muted); margin-top:4px; }
.profile-meta span { display:flex; align-items:center; gap:4px; }

/* SUMMARY CARDS */
.summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.summary-item {
    text-align: center;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.summary-item .num {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.summary-item .lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.pagination .pages { display: flex; gap: 4px; }
.pagination .pg {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.pg:hover { background: var(--slate-50); }
.pg.active { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    animation: flashIn 0.3s ease;
}

.flash i:first-child { font-size: 16px; }

.flash span { flex: 1; }

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
    font-size: 14px;
}
.flash-close:hover { opacity: 1; }

.flash-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green);
}
.flash-error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red);
}
.flash-warning {
    background: var(--yellow-bg);
    color: var(--yellow);
    border: 1px solid var(--yellow);
}
.flash-info {
    background: #eff6ff;
    color: var(--blue);
    border: 1px solid var(--blue);
}

@keyframes flashIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Pagination (PHP generated) */
.page-btn {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}
.page-btn:hover { background: var(--slate-50); }
.page-btn.active { background: var(--accent); color: var(--white); border-color: var(--accent); }
.page-dots { display: inline-flex; align-items: center; padding: 0 4px; color: var(--text-muted); font-size: 12px; }
.pg.disabled { opacity: 0.3; cursor: default; }

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-head h3 { font-size: 14px; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body { padding: 20px; }

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* FILIAL DROPDOWN */
.filial-dropdown {
    display: none;
    position: absolute;
    top: 48px;
    right: 120px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 260px;
    z-index: 200;
    overflow: hidden;
}

.filial-dropdown.show { display: block; }

.filial-dropdown .dd-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.filial-dropdown .dd-body { padding: 6px; }

.filial-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 12px;
}

.filial-opt:hover { background: var(--slate-50); }

.filial-opt.active {
    background: var(--accent-light);
}

.filial-opt .name { font-weight: 600; }
.filial-opt .cnpj { font-size: 11px; color: var(--text-muted); }
.filial-opt .check { margin-left: auto; color: var(--accent); font-size: 11px; }

/* INFO BOX */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    margin-bottom: 16px;
    background: var(--blue-bg);
    border: 1px solid var(--blue-border);
    color: var(--blue);
}

.info-box i { margin-top: 1px; }

/* LIST ITEMS */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.list-item:last-child { border-bottom: none; }

.list-ico {
    width: 34px; height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.list-info { flex: 1; }
.list-info .title { font-weight: 600; font-size: 13px; }
.list-info .desc { font-size: 11px; color: var(--text-muted); }

/* PLAN CARD */
.plan-card {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.plan-card .plan-name { font-weight: 700; font-size: 13px; }
.plan-card .plan-desc { font-size: 11px; color: var(--text-muted); }
.plan-card .plan-count { font-size: 20px; font-weight: 700; text-align: right; }
.plan-card .plan-count small { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }

/* RESPONSIVE */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .row.c2, .row.c3 { grid-template-columns: 1fr; }
    .summary-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .stats { grid-template-columns: 1fr; }
    .login-container { flex-direction: column; width: 100%; border-radius: 0; }
    .login-sidebar { width: 100%; padding: 32px 24px; }
}
