/* ============================================================
   MC Mangueiras ERP — Design System
   ============================================================ */

/* --- Tokens ------------------------------------------------- */
:root {
    --primary: #1a56db;
    --primary-dark: #1240a8;
    --primary-light: #e8f0ff;
    --secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg: #f0f4f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;

    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px 0 rgb(0 0 0/.1), 0 1px 2px -1px rgb(0 0 0/.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0/.1), 0 2px 4px -2px rgb(0 0 0/.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0/.1), 0 4px 6px -4px rgb(0 0 0/.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0/.1), 0 8px 10px -6px rgb(0 0 0/.1);

    --transition: .2s ease;
    --font: 'Inter', system-ui, sans-serif;
}

/* --- Reset -------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

input,
select,
textarea,
button {
    font-family: inherit;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-page {
    min-height: 100vh;
    background: var(--bg);
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-wrapper--register {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    padding: 2rem;
}

/* Auth Left panel */
.auth-left {
    background: linear-gradient(145deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, .06);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, .04);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, .2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.auth-logo--sm {
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: #fff;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.auth-brand h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: .5rem;
    z-index: 1;
    position: relative;
}

.auth-brand p {
    opacity: .8;
    font-size: 1rem;
    z-index: 1;
    position: relative;
}

.auth-features {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 1;
    position: relative;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, .12);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .15);
}

.auth-feature>i {
    font-size: 1.4rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-feature strong {
    display: block;
    font-size: .9rem;
    font-weight: 600;
}

.auth-feature span {
    font-size: .8rem;
    opacity: .8;
}

/* Auth Right panel */
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .25rem;
}

.auth-subtitle {
    color: var(--text-2);
    margin-bottom: 2rem;
    font-size: .95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-3);
    font-size: .85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer-text {
    text-align: center;
    font-size: .9rem;
    color: var(--text-2);
    margin-top: 1.5rem;
}

.auth-demo-hint {
    margin-top: 1.25rem;
    background: var(--primary-light);
    border: 1px solid #c7d9ff;
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .85rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.register-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: .25rem;
}

.register-header p {
    color: var(--text-2);
}

/* ============================================================
   LAYOUT: SIDEBAR + MAIN
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
    min-height: var(--topbar-h);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.logo-text {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-2);
    font-size: 1.25rem;
    padding: .35rem;
    border-radius: var(--radius-sm);
}

.sidebar-close:hover {
    background: var(--bg);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.nav-link i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link--danger {
    color: var(--danger) !important;
}

.nav-link--danger:hover {
    background: #fff1f1 !important;
}

.sidebar-footer {
    padding: .75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 199;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 100;
    box-shadow: var(--shadow);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-2);
    padding: .35rem;
    border-radius: var(--radius-sm);
}

.hamburger:hover {
    background: var(--bg);
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.user-role {
    font-size: .75rem;
    color: var(--text-3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1.75rem;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Page header ------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header p {
    color: var(--text-2);
    font-size: .9rem;
    margin-top: .25rem;
}

/* --- Cards -------------------------------------------------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: .95rem;
}

/* --- KPI Cards --------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow var(--transition), transform var(--transition);
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-icon--blue {
    background: var(--primary-light);
    color: var(--primary);
}

.kpi-icon--green {
    background: #d1fae5;
    color: var(--success);
}

.kpi-icon--red {
    background: #fee2e2;
    color: var(--danger);
}

.kpi-icon--yellow {
    background: #fef3c7;
    color: var(--warning);
}

.kpi-icon--purple {
    background: #ede9fe;
    color: var(--secondary);
}

.kpi-info {
    flex: 1;
    min-width: 0;
}

.kpi-label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.kpi-sub {
    font-size: .75rem;
    color: var(--text-3);
    margin-top: .3rem;
}

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(.97);
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(26, 86, 219, .35);
}

.btn--secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    background: var(--border-light);
}

.btn--success {
    background: var(--success);
    color: #fff;
}

.btn--success:hover {
    background: #059669;
}

.btn--danger {
    background: var(--danger);
    color: #fff;
}

.btn--danger:hover {
    background: #dc2626;
}

.btn--outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn--outline:hover {
    background: var(--primary-light);
}

.btn--ghost {
    background: transparent;
    color: var(--text-2);
}

.btn--ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.btn--sm {
    padding: .4rem .9rem;
    font-size: .82rem;
}

.btn--lg {
    padding: .8rem 1.75rem;
    font-size: 1rem;
}

.btn--full {
    width: 100%;
    justify-content: center;
}

.btn--google {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow);
}

.btn--google:hover {
    background: var(--bg);
    box-shadow: var(--shadow-md);
}

.btn-group {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* --- Forms ------------------------------------------------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.form-group label {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.input-icon {
    position: relative;
}

.input-icon>i:first-child {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 1rem;
    pointer-events: none;
}

.input-icon input {
    padding-left: 2.5rem;
}

.input-icon input[type="password"] {
    padding-right: 2.75rem;
}

.input-toggle-pass {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    font-size: 1rem;
    padding: .2rem;
}

.input-toggle-pass:hover {
    color: var(--text-2);
}

/* --- Alerts ------------------------------------------------ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 1rem;
}

.alert i {
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.alert--warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* --- Badges ------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 100px;
    font-size: .75rem;
    font-weight: 600;
}

.badge--green {
    background: #d1fae5;
    color: #065f46;
}

.badge--red {
    background: #fee2e2;
    color: #991b1b;
}

.badge--yellow {
    background: #fef3c7;
    color: #92400e;
}

.badge--blue {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge--gray {
    background: #f1f5f9;
    color: #475569;
}

/* --- Tables ------------------------------------------------ */
.table-wrapper {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.data-table thead th {
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    color: var(--text-2);
    letter-spacing: .04em;
    border-bottom: 2px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

.data-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--surface-2);
}

/* --- Tabs -------------------------------------------------- */
.tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: .65rem 1.25rem;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-2);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* --- Modal ------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, .5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.open {
    display: flex;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    font-size: 1.3rem;
    padding: .2rem;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

@keyframes slideUp {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Charts container -------------------------------------- */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.chart-card .card-header {
    padding: 1rem 1.5rem;
}

.chart-canvas-wrap {
    padding: 1.25rem;
}

canvas {
    max-height: 260px;
}

/* --- Search + Filters row ---------------------------------- */
.filters-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

.filters-row .form-group {
    min-width: 160px;
    flex: 1;
}

/* --- Empty state ------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-3);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-2);
    margin-bottom: .5rem;
}

.empty-state p {
    font-size: .9rem;
}

/* --- Pagination -------------------------------------------- */
.pagination {
    display: flex;
    gap: .35rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.page-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* --- Utility ---------------------------------------------- */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-green {
    color: var(--success);
}

.text-red {
    color: var(--danger);
}

.text-muted {
    color: var(--text-2);
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: .5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.gap-1 {
    gap: .5rem;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* --- Spinner ---------------------------------------------- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 2rem 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-row .form-group {
        min-width: 100%;
    }

    .main-content {
        padding: 1.25rem 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ============================================================
   PRINT / PDF
   ============================================================ */
@media print {

    .sidebar,
    .sidebar-overlay,
    .topbar,
    .hamburger,
    .btn,
    .btn-group,
    .filters-row,
    .pagination,
    .modal,
    .alert[data-dismiss] {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .main-content {
        padding: 0 !important;
    }

    body {
        background: #fff !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }

    .kpi-card {
        break-inside: avoid;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table thead th {
        background: #eee !important;
    }

    @page {
        margin: 1.5cm;
        size: A4;
    }
}