/* ============================================================
   DOM DA EMPADA — Design System (Inspired by TailAdmin)
   Fonte: Outfit (Google Fonts)
   Paleta primária: #800000 (marrom-vinho) adaptado ao estilo
   clean e enterprise do TailAdmin
   ============================================================ */

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

/* ========== RESET & BASE ========== */
*,
::before,
::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-color: #e4e7ec;
}

:root {
    /* Brand Colors (Dom da Empada — vinho adaptado ao TailAdmin) */
    --brand-50: #fff0f0;
    --brand-100: #ffe0e0;
    --brand-200: #ffbaba;
    --brand-300: #ff8a8a;
    --brand-400: #ff4d4d;
    --brand-500: #800000;
    --brand-600: #6b0000;
    --brand-700: #550000;
    --brand-800: #400000;
    --brand-900: #2d0000;

    /* Gray Scale (TailAdmin exato) */
    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f2f4f7;
    --gray-200: #e4e7ec;
    --gray-300: #d0d5dd;
    --gray-400: #98a2b3;
    --gray-500: #667085;
    --gray-600: #475467;
    --gray-700: #344054;
    --gray-800: #1d2939;
    --gray-900: #101828;

    /* Feedback colors */
    --success-50: #ecfdf3;
    --success-100: #d1fadf;
    --success-500: #12b76a;
    --success-700: #027a48;
    --error-50: #fef3f2;
    --error-100: #fee4e2;
    --error-500: #f04438;
    --error-700: #b42318;
    --warning-50: #fffaeb;
    --warning-500: #f79009;

    /* Shadows (TailAdmin exato) */
    --shadow-xs: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06);
    --shadow-md: 0px 4px 8px -2px rgba(16, 24, 40, 0.10), 0px 2px 4px -2px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);

    /* Layout */
    --sidebar-width: 290px;
    --header-height: 72px;

    /* Spacing System — padrão do sistema: 20px */
    --gap-base: 20px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
}

/* ========== LAYOUT PRINCIPAL ========== */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR (Estilo TailAdmin) ========== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: #ffffff;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    transition: transform 0.3s ease-in-out;
}

/* Scrollbar discreta na sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 99px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-300);
}

/* Logo área */
.sidebar .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar .logo img {
    max-width: 140px;
    height: auto;
}

/* Saudação ao usuário */
.user-greeting {
    padding: 16px 16px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Links da sidebar */
.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 2px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar a:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
}

.sidebar a.active {
    background-color: var(--brand-50);
    color: var(--brand-500);
}

/* Separador dentro do menu */
.sidebar hr {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 12px 16px;
}

/* Link de logout — diferenciado */
.sidebar a.logout-link {
    color: var(--error-500);
    margin-top: auto;
}

.sidebar a.logout-link:hover {
    background-color: var(--error-50);
    color: var(--error-700);
}

/* Grupo label (ex: "MENU", "SUPORTE") */
.sidebar .nav-group-label {
    padding: 12px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ========== MOBILE HEADER ========== */

.mobile-header {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 20px;
    height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1100;
    box-shadow: var(--shadow-sm);
}

.mobile-header .logo img {
    max-height: 36px;
}

.mobile-header .menu-toggle {
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
    box-shadow: none;
}

.mobile-header .menu-toggle:hover {
    background: var(--gray-100);
    transform: none;
    box-shadow: none;
}

/* ========== CONTEÚDO PRINCIPAL ========== */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* Títulos de página */
.main-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--gap-base);
    letter-spacing: -0.3px;
}

.main-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--gap-base);
}

.sep-titulo {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

/* ========== ABAS ========== */

.tabs-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    margin: 0 0 var(--gap-base);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    box-shadow: var(--shadow-xs);
}

.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tab-button:hover {
    color: var(--brand-500);
    background: #fff;
}

.tab-button.active {
    background: var(--brand-500);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.drag-col {
    width: 46px;
}

.drag-cell {
    width: 46px;
    text-align: center;
}

.drag-col-inline {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-500);
    font-size: 16px;
    font-weight: 700;
    cursor: grab;
    box-shadow: var(--shadow-xs);
}

.drag-handle:hover {
    color: var(--gray-600);
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.drag-handle:active {
    cursor: grabbing;
}

[data-sortable-row].is-dragging {
    opacity: 0.45;
}

/* ========== DASHBOARD GERENCIAL ========== */

.manager-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: var(--gap-base);
    margin: var(--gap-base) 0;
}

.manager-kpi {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-xs);
}

.manager-kpi span {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.manager-kpi strong {
    display: block;
    color: var(--gray-800);
    font-size: 24px;
    line-height: 1;
}

.manager-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap-base);
    margin-bottom: var(--gap-base);
}

.manager-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow-xs);
}

.manager-panel-wide {
    margin-top: var(--gap-base);
}

.manager-panel h3 {
    margin: 0 0 14px;
    color: var(--gray-800);
    font-size: 16px;
}

.bar-row {
    margin-bottom: 12px;
}

.bar-row:last-child {
    margin-bottom: 0;
}

.bar-row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 5px;
    font-size: 13px;
}

.bar-row-head span {
    color: var(--gray-700);
    font-weight: 600;
}

.bar-row-head strong {
    color: var(--gray-800);
    font-size: 12px;
}

.bar-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: var(--gray-100);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    min-width: 4px;
    border-radius: 999px;
    background: var(--brand-500);
}

.bar-fill-alt {
    background: var(--success-500);
}

.bar-fill-muted {
    background: var(--gray-500);
}

.day-chart {
    height: 210px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding-top: 12px;
    overflow-x: auto;
}

.day-bar {
    min-width: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.day-bar-fill {
    width: 18px;
    border-radius: 6px 6px 0 0;
    background: var(--brand-500);
}

.day-bar span {
    color: var(--gray-500);
    font-size: 10px;
    white-space: nowrap;
}

/* ========== CARDS / SEÇÕES ========== */

.card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--gap-base);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: var(--gap-base);
}

/* Categoria (ex: produtos por categoria) */
.categoria {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px;
}

.categoria h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    margin: 0;
}

/* ========== FORMULÁRIOS ========== */

form {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid de formulário */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Labels */
label,
form label,
.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    display: block;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: var(--gray-800);
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0 14px;
    height: 44px;
    line-height: 42px;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-xs);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23667085'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px !important;
}

textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.08);
    outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--gray-50);
    color: var(--gray-400);
    border-color: var(--gray-200);
    cursor: not-allowed;
}

/* Input compacto para tabelas */
.input-sm {
    height: 36px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    max-width: 110px;
}

/* Form sem card (dentro de tabela, loop, etc.) */
form.inline-form,
.main form.inline-form {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    gap: 20px;
    flex-direction: row;
    align-items: center;
}

/* ========== BOTÕES ========== */

button:not([class]),
input[type="submit"],
.btn {
    font-family: 'Outfit', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    background: var(--brand-500);
    color: #ffffff;
    box-shadow: var(--shadow-xs);
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background: var(--brand-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: #ffffff;
    text-decoration: none;
}

button:active,
input[type="submit"]:active,
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

/* Botão secundário (outline) */
.btn-secondary {
    background: #ffffff;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--gray-800);
    border-color: var(--gray-400);
}

/* Botão ghost */
.btn-ghost {
    background: transparent;
    color: var(--brand-500);
    border-color: transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--brand-50);
    color: var(--brand-500);
    box-shadow: none;
}

/* Botões de ação */
.btn-danger,
button.danger {
    background: var(--error-500);
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover,
button.danger:hover {
    background: var(--error-700);
    color: #fff;
}

.btn-warning {
    background: var(--warning-500);
    color: #fff;
    border-color: transparent;
}

.btn-warning:hover {
    background: #d97706;
    color: #fff;
}

.btn-info {
    background: #3b82f6;
    color: #fff;
    border-color: transparent;
}

.btn-info:hover {
    background: #2563eb;
    color: #fff;
}

/* Tamanhos alternativos */
.btn-sm {
    height: 36px;
    padding: 6px 14px;
    font-size: 13px;
}

/* Aliases de botões legados */
.btn-excluir {
    background: var(--error-500);
    color: #fff;
    border-color: transparent;
}

.btn-excluir:hover {
    background: var(--error-700);
    color: #fff;
}

.btn-suspender {
    background: var(--warning-500);
    color: #fff;
    border-color: transparent;
}

.btn-suspender:hover {
    background: #d97706;
}

.btn-reativar {
    background: #3b82f6;
    color: #fff;
    border-color: transparent;
}

.btn-reativar:hover {
    background: #2563eb;
}

/* ========== BOTÕES DE AÇÃO EM TABELAS ========== */
/* Padrão: mesmo height dos inputs (44px normal / 36px compacto),
   sempre em linha com gap: 10px                                    */

.btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    height: 44px;
    padding: 0 14px;
    border-radius: 7px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    background: var(--success-500);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn-save:hover {
    background: var(--success-700);
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    height: 44px;
    padding: 0 14px;
    border-radius: 7px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    background: #3b82f6;
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn-edit:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    height: 44px;
    padding: 0 14px;
    border-radius: 7px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    background: var(--error-500);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn-delete:hover {
    background: var(--error-700);
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 14px;
    border-radius: 7px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    background: #f79009;
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn-warning:hover {
    background: #d97706;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 14px;
    border-radius: 7px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    background: #3b82f6;
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn-info:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Container de ações em linha dentro de td */
.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* Form inline dentro de tabela (sem card, sem gap extra) */
.inline-form {
    display: flex;
    align-items: center;
    gap: 20px;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

/* Input compacto padronizado para uso em tabelas */
.input-table {
    height: 44px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--gray-300);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    background: #fff;
    color: var(--gray-800);
    box-shadow: var(--shadow-xs);
    min-width: 0;
    width: 100%;
}

.input-table:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.07);
    outline: none;
}

/* Select compacto para tabelas */
select.input-table {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23667085'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px !important;
    line-height: 34px;
}

/* ========== TABELAS ========== */

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
    font-size: 14px;
}

thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background-color: var(--gray-25);
}

/* Larguras de Colunas Padronizadas */
.col-name {
    width: 35%;
}

.col-email {
    width: 40%;
}

.col-actions {
    width: 25%;
    text-align: right;
}

.col-actions .table-actions {
    justify-content: flex-end;
}

.col-p-25 {
    width: 25%;
}

.col-actions-25 {
    width: 25%;
    text-align: right;
}

.col-actions-25 .table-actions {
    justify-content: flex-end;
}

/* Colunas product-table (Editor) */
.product-table td.col-large {
    width: 40%;
}

.product-table td.col-medium {
    width: 10%;
}

.product-table td.col-actions-3 {
    width: 40%;
}


/* ========== ALERTS / MENSAGENS ========== */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
}

.alert-success {
    background: var(--success-50);
    color: var(--success-700);
    border-color: var(--success-100);
    border-left-color: var(--success-500);
}

.alert-danger {
    background: var(--error-50);
    color: var(--error-700);
    border-color: var(--error-100);
    border-left-color: var(--error-500);
}

.alert-warning {
    background: var(--warning-50);
    color: #b45309;
    border-color: #fef0c7;
    border-left-color: var(--warning-500);
}

/* Compat: fallbacks para inline styles antigos */
p[style*="color: green"],
p[style*="color:green"],
.success-msg {
    display: block;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    background: var(--success-50);
    color: var(--success-700) !important;
    border: 1px solid var(--success-100);
    border-left: 4px solid var(--success-500);
}

p[style*="color: red"],
p[style*="color:red"],
.error-msg,
.error-message {
    display: block;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    background: var(--error-50);
    color: var(--error-700) !important;
    border: 1px solid var(--error-100);
    border-left: 4px solid var(--error-500);
}

/* ========== LINKS ========== */

a {
    color: var(--brand-500);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--gray-600);
}

.back-link:hover {
    color: var(--brand-500);
    text-decoration: none;
}

.alinha_acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alinha_acoes a {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s;
    text-decoration: none;
}

.alinha_acoes a:hover {
    background: var(--gray-100);
    text-decoration: none;
}

/* ========== TELA DE LOGIN ========== */

.login-body {
    background: var(--gray-100);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-container img {
    max-width: 180px;
    margin-bottom: 28px;
}

.login-container h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.login-container p.subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 28px;
}

.login-container form {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 16px;
    text-align: left;
}

.login-container button,
.login-container input[type="submit"] {
    width: 100%;
    height: 48px;
    font-size: 15px;
    margin-top: 8px;
}

/* ========== PAGINAÇÃO ========== */

.paginacao {
    display: flex;
    align-items: center;
    gap: var(--gap-base);
    margin-top: var(--gap-base);
    flex-wrap: wrap;
}

.paginacao a {
    padding: 6px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.paginacao a:hover {
    background: var(--gray-100);
    text-decoration: none;
}

.paginacao span {
    font-size: 14px;
    color: var(--gray-500);
}

/* ========== CARDS DE NAVEGAÇÃO (admin / painel) ========== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--gap-base);
}

.nav-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px var(--gap-base);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
}

.nav-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.nav-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.nav-card p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.nav-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-500);
    margin-top: 4px;
}

/* ========== DASHBOARD — CENTRAL DE PEDIDOS ========== */

.produto-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-base);
    padding: 10px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.produto-item:last-of-type {
    border-bottom: none;
}

.produto-item label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
}

.produto-item select {
    width: 120px;
    flex-shrink: 0;
}

.subtotal {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    text-align: right;
}

/* ========== CHECKBOXES (suspensão de produtos) ========== */

.check-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}

.check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    padding: 0;
    border: none;
    box-shadow: none;
    accent-color: var(--brand-500);
    cursor: pointer;
    flex-shrink: 0;
    line-height: normal;
}

/* ========== SEPARADOR HORIZONTAL ========== */

.sep-hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: var(--gap-base) 0;
}

/* ========== FORM SEM CARD (transparente) ========== */

form.form-plain {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

/* ========== FLEX HELPERS PARA LINHAS DE TABELA ========== */

.flex-3 {
    flex: 3;
    min-width: 0;
}

.flex-2 {
    flex: 2;
    min-width: 0;
}

.flex-1 {
    flex: 1;
    min-width: 0;
}

/* ========== PÁGINA SEM RESULTADOS ========== */

.empty-state {
    padding: 48px var(--gap-base);
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
}

/* ========== IMPRESSÃO ========== */

@media print {

    .sidebar,
    .mobile-header,
    button,
    .btn,
    form {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
}

/* ========== RESPONSIVIDADE ========== */

/* ========== RESPONSIVO — TABLET (≤ 1024px) ========== */
@media (max-width: 1024px) {
    .manager-kpis,
    .manager-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Inline-form de tabelas: empilha em 2 colunas no tablet */
    .inline-form {
        flex-wrap: wrap;
    }

    .inline-form .flex-3 { flex: 1 1 100%; }
    .inline-form .flex-1 { flex: 1 1 calc(50% - 10px); }
}

/* ========== RESPONSIVO — MOBILE (≤ 768px) ========== */
@media (max-width: 768px) {
    .manager-kpis,
    .manager-grid {
        grid-template-columns: 1fr;
    }

    .manager-kpi strong {
        font-size: 20px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }

    /* Formulários: 1 coluna em todas as variantes */
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    /* Tabelas: scroll horizontal */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 12px;
    }

    /* Inline-form de tabelas (produtos, unidades): empilha verticalmente */
    .inline-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .inline-form .flex-3,
    .inline-form .flex-1 {
        flex: 1 1 100%;
        width: 100%;
    }

    /* Ações da tabela inline: botões lado a lado com quebra */
    .inline-form .table-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Produto item (dashboard de pedidos): empilha label e select */
    .produto-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }

    .produto-item select {
        width: 100%;
    }

    .subtotal {
        padding: 8px 16px;
    }

    /* Cards de navegação: 1 coluna */
    .cards-grid {
        grid-template-columns: 1fr;
    }

    /* Filtros de logs/relatórios: 1 coluna */
    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-group {
        min-width: 100%;
        flex: 1 1 100%;
    }

    /* Paginação: centraliza e diminui espaçamento */
    .paginacao {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    /* Checkboxes de suspensão: espaçamento menor */
    .check-item {
        padding: 8px 10px;
    }

    /* Botões de ação em tabelas: menores no mobile */
    .table-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Título da página: tamanho menor */
    .main-content h2 {
        font-size: 20px;
    }

    .main-content h3 {
        font-size: 15px;
    }

    /* Cards */
    .card-body {
        padding: 16px;
    }

    /* Botão submit de largura total em mobile */
    form > button[type="submit"],
    form > .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== RESPONSIVO — MOBILE PEQUENO (≤ 480px) ========== */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
        padding-top: calc(var(--header-height) + 12px);
    }

    .nav-card {
        padding: 16px;
    }

    .paginacao a,
    .paginacao span {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
}

/* ========== PASSWORD SECURITY UI ========== */

.password-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-control-container {
    position: relative;
    width: 100%;
}

.password-control-container input {
    padding-right: 80px !important; /* Espaço para o botão de geração e toggle */
}

.password-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.btn-icon-action {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.btn-icon-action:hover {
    background: var(--gray-100);
    color: var(--brand-500);
    border-color: var(--brand-200);
    transform: translateY(0);
}

.btn-icon-action svg {
    width: 18px;
    height: 18px;
}

/* Medidor de Força */
.strength-meter-container {
    width: 100%;
    margin-top: 4px;
}

.strength-meter-bar {
    height: 4px;
    width: 100%;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
    display: flex;
    gap: 4px;
}

.strength-meter-segment {
    height: 100%;
    flex: 1;
    background: transparent;
    transition: background 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Estados de Força */
[data-strength="0"] .strength-text { color: var(--gray-400); }
[data-strength="1"] .strength-meter-segment:nth-child(1) { background: #f04438; } /* Fraca */
[data-strength="1"] .strength-text { color: #f04438; }

[data-strength="2"] .strength-meter-segment:nth-child(1),
[data-strength="2"] .strength-meter-segment:nth-child(2) { background: #f79009; } /* Média */
[data-strength="2"] .strength-text { color: #f79009; }

[data-strength="3"] .strength-meter-segment:nth-child(1),
[data-strength="3"] .strength-meter-segment:nth-child(2),
[data-strength="3"] .strength-meter-segment:nth-child(3) { background: #12b76a; } /* Forte */
[data-strength="3"] .strength-text { color: #12b76a; }
