:root {
    --primary: #0066CC;
    /* Azul Anglo original */
    --sidebar-bg: #00457A;
    /* Azul Escuro Marinho do Padrão Stitch */
    --success: #28a745;
    /* Verde aprovado */
    --warning: #ffc107;
    /* Amarelo pendente */
    --danger: #dc3545;
    /* Vermelho rejeitado */
    --info: #17a2b8;
    /* Azul informação */
    --dark: #343a40;
    /* Cinza escuro */
    --light: #f8f9fa;
    /* Cinza claro */
    --border-radius: 8px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: #f0f2f5;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header p {
    color: #666;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.btn:hover {
    background: #0052a3;
}

/* Botão Stitch Global — funciona em qualquer contexto */
.btn-stitch {
    display: inline-block;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 13px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-family);
}

.btn-stitch:hover {
    background: #00335a;
}

/* Botão Secundário Outline */
.btn-outline {
    display: inline-block;
    background: #fff;
    color: #333;
    padding: 13px 24px;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: var(--font-family);
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

/* Botões de Ação Específicos (Aprovar / Rejeitar) */
.btn-approve {
    display: inline-block;
    background: var(--success);
    color: #fff;
    padding: 13px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-family);
}

.btn-approve:hover {
    background: #218838;
}

.btn-reject {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    padding: 13px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-family);
}

.btn-reject:hover {
    background: #c82333;
}

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: none;
}

.alert.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================
   LAYOUTS STITCH (FASE 6) — Fiel aos Protótipos
   ========================================== */

/* ---- Admin Dashboard Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
    font-family: var(--font-family);
    background: #f4f6fa;
}

/* Sidebar: Fundo BRANCO, texto azul escuro */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: #ffffff;
    color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8ecf0;
    z-index: 10;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--sidebar-bg);
    border-bottom: 1px solid #e8ecf0;
}

.sidebar-header .logo-mini {
    width: 100px;
    height: 100px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
}

.sidebar-header .logo-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex: 1;
}

.sidebar-menu li {
    padding: 0 12px;
    margin-bottom: 2px;
}

.sidebar-menu button {
    width: 100%;
    background: transparent;
    border: none;
    color: #5a6977;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-family);
}

.sidebar-menu button:hover {
    background: #f0f4f8;
    color: var(--sidebar-bg);
}

.sidebar-menu button.active {
    background: var(--sidebar-bg);
    color: #ffffff;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #e8ecf0;
}

.sidebar-footer button {
    width: 100%;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-family);
}

.sidebar-footer button:hover {
    background: #f8f9fa;
    color: var(--danger);
    border-color: var(--danger);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

/* Topbar */
.topbar {
    background: white;
    height: 64px;
    min-height: 64px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8ecf0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-search {
    background: #f4f6fa;
    border: 1px solid #e0e0e0;
    padding: 10px 16px 10px 36px;
    border-radius: 8px;
    width: 300px;
    outline: none;
    font-size: 14px;
    color: #333;
    font-family: var(--font-family);
}

.topbar-search:focus {
    border-color: var(--sidebar-bg);
    box-shadow: 0 0 0 2px rgba(0, 69, 122, 0.08);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #333;
}

.topbar-user .avatar {
    width: 36px;
    height: 36px;
    background: var(--sidebar-bg);
    border-radius: 50%;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
}

/* Dashboard Content */
.dashboard-content {
    padding: 30px;
    max-width: 1200px;
    width: 100%;
}

/* ---- KPI Stat Cards (Dashboard) ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e8ecf0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.kpi-card .kpi-info label {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    display: block;
    margin-bottom: 6px;
}

.kpi-card .kpi-info .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.kpi-card .kpi-info .kpi-sub {
    font-size: 12px;
    color: var(--success);
    margin-top: 4px;
}

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon-orange {
    background: #fff3e0;
    color: #e65100;
}

.kpi-icon-green {
    background: #e8f5e9;
    color: #2e7d32;
}

.kpi-icon-blue {
    background: #e3f2fd;
    color: #1565c0;
}

.kpi-icon-purple {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* ---- Data Table Stitch ---- */
.stitch-table-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e8ecf0;
    overflow: hidden;
}

.stitch-table-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8ecf0;
}

.stitch-table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.stitch-table-header a {
    font-size: 13px;
    color: var(--sidebar-bg);
    text-decoration: none;
    font-weight: 500;
}

.stitch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stitch-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e8ecf0;
    background: #fafbfc;
}

.stitch-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.stitch-table tbody tr:hover {
    background: #f8fafc;
}

.stitch-table tbody td {
    padding: 14px 16px;
    color: #333;
    vertical-align: middle;
}

.stitch-table .user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stitch-table .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.stitch-table .action-icons {
    display: flex;
    gap: 8px;
}

.stitch-table .action-icons button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.stitch-table .action-icons button:hover {
    background: #f0f0f0;
}

/* Badges de Status e Urgência */
.badge-stitch {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-aguardando,
.badge-pendente {
    background: #fff8e1;
    color: #f57f17;
}

.badge-aprovada {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-rejeitada {
    background: #fce4ec;
    color: #c62828;
}

.badge-alta {
    background: #fce4ec;
    color: #c62828;
}

.badge-urgente {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
}

.badge-media {
    background: #fff8e1;
    color: #f57f17;
}

.badge-baixa {
    background: #e8f5e9;
    color: #2e7d32;
}

/* ---- Login Centralizado (Stitch V1) ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2f7 0%, #dce5f0 100%);
    font-family: var(--font-family);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 45px 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    text-align: center;
}

/* ==========================================
   MODAIS E OVERLAYS
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.login-card .logo-circle {
    width: 200px;
    height: 200px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;

}

.login-card .logo-circle img {
    width: 140px;
}

.login-card h2 {
    color: var(--sidebar-bg);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-card .login-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 18px;
}

.login-card .form-group label {
    color: var(--sidebar-bg);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.login-card .input-icon-wrap {
    position: relative;
}

.login-card .input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
    pointer-events: none;
}

.login-card .input-icon-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-family);
    transition: border-color 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.login-card .input-icon-wrap input:focus {
    outline: none;
    border-color: var(--sidebar-bg);
    box-shadow: 0 0 0 2px rgba(0, 69, 122, 0.08);
}

.login-card .btn-stitch {
    background: var(--sidebar-bg);
    color: white;
    border: none;
    padding: 13px;
    border-radius: 8px;
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 5px;
    font-family: var(--font-family);
}

.login-card .btn-stitch:hover {
    background: #00335a;
}

.login-card .login-footer {
    margin-top: 20px;
    font-size: 13px;
    color: #999;
}

.login-card .login-footer a {
    color: var(--sidebar-bg);
    text-decoration: none;
    font-weight: 500;
}

/* ---- Formulário Público Stitch ---- */
.public-form-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6fa;
    padding: 30px;
    font-family: var(--font-family);
}

.public-form-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8ecf0;
}

.public-form-card .form-header {
    text-align: center;
    margin-bottom: 30px;
}

.public-form-card .form-header .logo-circle {
    width: 120px;
    height: 120px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;

}

.public-form-card .form-header .logo-circle img {
    width: 80px;
}

.public-form-card .form-header h2 {
    color: var(--sidebar-bg);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.public-form-card .form-header p {
    color: #888;
    font-size: 14px;
}

.public-form-card .form-group label {
    color: var(--sidebar-bg);
    font-size: 13px;
    font-weight: 600;
}

.public-form-card .form-group label .req {
    color: #e65100;
}

.public-form-card .input-icon-wrap {
    position: relative;
}

.public-form-card .input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 14px;
    color: #aaa;
    font-size: 16px;
    pointer-events: none;
}

.public-form-card .input-icon-wrap input,
.public-form-card .input-icon-wrap select,
.public-form-card .input-icon-wrap textarea {
    padding-left: 42px;
}

.public-form-card .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.public-form-card .btn-outline {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
}

.public-form-card .btn-outline:hover {
    background: #f8f9fa;
}

.public-form-card .btn-stitch {
    background: var(--sidebar-bg);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.2s;
}

.public-form-card .btn-stitch:hover {
    background: #00335a;
}

/* Radio Buttons Urgência */
.urgency-radios {
    display: flex;
    gap: 25px;
    margin-top: 8px;
}

.urgency-radios label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #555 !important;
    cursor: pointer;
}

.urgency-radios input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sidebar-bg);
}

/* ==========================================
   UX MODERNA - TOASTS E MODAIS
   ========================================== */

/* TOASTS */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    background: #fff;
    min-width: 300px;
    max-width: 400px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease forwards;
    border-left: 5px solid #ccc;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 20px;
    margin-right: 12px;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 3px;
    color: var(--dark);
}

.toast-message {
    font-size: 14px;
    color: #666;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    margin-left: 10px;
}

.toast-close:hover {
    color: #333;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* MODAL CUSTOMIZADO */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease forwards;
}

.custom-modal {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease forwards;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.modal-description {
    font-size: 14px;
    color: #666;
}

.modal-body {
    margin-bottom: 25px;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer .btn {
    width: auto;
    padding: 10px 20px;
}

.modal-footer .btn-secondary {
    background: #f0f2f5;
    color: #333;
}

.modal-footer .btn-secondary:hover {
    background: #e4e6e9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* CARREGAMENTO DE BOTÕES (SPINNER) */
.btn-loading {
    cursor: not-allowed !important;
    opacity: 0.8;
}

.btn-spinner,
.default-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-secondary .btn-spinner {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* CAIXAS SEPARADAS PARA OTP 6 Digitos (Estilo iCloud) */
.otp-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.otp-box {
    width: 45px;
    height: 55px;
    font-size: 24px !important;
    text-align: center;
    font-weight: bold;
    color: var(--primary);
    background-color: #f4f6fa;
    border: 2px solid #e0e4eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 0;
}

.otp-box:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
    transform: translateY(-2px);
}

/* ==========================================
   RESPONSIVIDADE MOBILE-FIRST
   ========================================== */

/* Hamburger Menu Button (oculto por padrão no desktop) */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--sidebar-bg);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
    line-height: 1;
}

.hamburger-btn:hover {
    background: #f0f4f8;
}

/* Overlay escuro quando sidebar está aberta no mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ---- TABLET: ≤ 1024px ---- */
@media (max-width: 1024px) {

    /* KPI e Stats: 2 colunas */
    .kpi-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Charts: 1 coluna */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    /* Form grid: 2 colunas */
    .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    /* Topbar search menor */
    .topbar-search {
        width: 200px;
    }

    /* Dashboard content padding reduzido */
    .dashboard-content {
        padding: 20px;
    }
}

/* ---- MOBILE: ≤ 768px ---- */
@media (max-width: 768px) {

    /* === SIDEBAR: Drawer deslizante === */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        min-width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Hamburger visível */
    .hamburger-btn {
        display: flex;
        align-items: center;
    }

    /* Logo menor na sidebar mobile */
    .sidebar-header .logo-mini {
        width: 56px;
        height: 56px;
    }

    .sidebar-header .logo-mini img {
        width: 40px;
    }

    /* === TOPBAR MOBILE === */
    .topbar {
        padding: 0 16px;
        height: 56px;
        min-height: 56px;
    }

    /* Esconder search e texto do username no mobile */
    .topbar-search {
        display: none;
    }

    .topbar-user span:not(.topbar-user .avatar) {
        display: none;
    }

    .topbar-user .avatar {
        display: flex;
    }

    /* === CONTEÚDO === */
    .dashboard-content {
        padding: 16px;
    }

    /* KPI e Stats: 1 coluna */
    .kpi-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .kpi-card {
        padding: 16px;
    }

    .kpi-card .kpi-info .kpi-value {
        font-size: 24px;
    }

    /* Charts e admin-card: 1 coluna */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Form grid: 1 coluna */
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    /* === TABELAS RESPONSIVAS (row → card) === */
    .stitch-table thead {
        display: none;
    }

    .stitch-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid #e8ecf0;
        border-radius: 12px;
        background: white;
    }

    .stitch-table tbody tr:hover {
        background: white;
    }

    .stitch-table tbody td {
        padding: 6px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
    }

    .stitch-table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-width: 100px;
    }

    .stitch-table-card {
        border: none;
        background: transparent;
    }

    .stitch-table-header {
        padding: 12px 0;
        border-bottom: none;
    }

    /* === LOGIN RESPONSIVO === */
    .login-card {
        padding: 30px 24px;
        border-radius: 12px;
    }

    .login-card .logo-circle {
        width: 140px;
        height: 140px;
    }

    .login-card .logo-circle img {
        width: 100px;
    }

    .login-card h2 {
        font-size: 20px;
    }

    /* === FORMULÁRIO PÚBLICO RESPONSIVO === */
    .public-form-card {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .public-form-page {
        padding: 16px;
        align-items: flex-start;
    }

    .public-form-card .form-header .logo-circle {
        width: 90px;
        height: 90px;
    }

    .public-form-card .form-header .logo-circle img {
        width: 60px;
    }

    .public-form-card .form-header h2 {
        font-size: 18px;
    }

    .public-form-card .form-actions {
        flex-direction: column;
    }

    .public-form-card .form-actions button,
    .public-form-card .form-actions .btn-stitch,
    .public-form-card .form-actions .btn-outline {
        width: 100%;
        text-align: center;
    }

    /* Radio urgência: empilhado */
    .urgency-radios {
        flex-direction: column;
        gap: 12px;
    }

    /* ACL options: empilhado */
    .acl-options {
        flex-direction: column;
        gap: 10px;
    }

    /* Perfil card: full width */
    .admin-card[style*="max-width"] {
        max-width: 100% !important;
    }

    /* Stat cards */
    .stat-card {
        padding: 16px;
    }

    .stat-card strong {
        font-size: 22px;
    }

    /* Section title */
    .section-title {
        font-size: 18px;
    }

    /* Toasts mobile */
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    /* Modal mobile */
    .custom-modal {
        width: 95%;
        margin: 20px;
    }

    /* Purchase cards */
    .details-grid {
        grid-template-columns: 1fr;
    }

    .purchase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .actions {
        flex-direction: column;
        width: 100%;
    }

    .actions button {
        width: 100%;
    }

    /* OTP boxes menores */
    .otp-box {
        width: 38px;
        height: 48px;
        font-size: 20px !important;
    }
}

/* ---- MOBILE PEQUENO: ≤ 480px ---- */
@media (max-width: 480px) {
    .login-card {
        padding: 24px 18px;
    }

    .login-card .logo-circle {
        width: 110px;
        height: 110px;
    }

    .login-card .logo-circle img {
        width: 76px;
    }

    .login-card h2 {
        font-size: 18px;
    }

    .login-card .login-subtitle {
        font-size: 13px;
    }

    .public-form-card {
        padding: 20px 16px;
    }

    .public-form-card .form-header .logo-circle {
        width: 70px;
        height: 70px;
    }

    .public-form-card .form-header .logo-circle img {
        width: 48px;
    }

    .kpi-card .kpi-info .kpi-value {
        font-size: 22px;
    }

    .kpi-card .kpi-info label {
        font-size: 12px;
    }

    /* Body text scaling */
    body {
        font-size: 14px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        /* Evita zoom no iOS */
    }
}