/* ============================================================
   DRATEC ENGENHARIA
   SISTEMA DE GESTÃO DE ESTOQUE
   ESTILOS GLOBAIS
   ============================================================ */


/* ============================================================
   VARIÁVEIS DO SISTEMA
   ============================================================ */

:root {
    /* Fundos */
    --bg-main: #061727;
    --bg-sidebar: #071c2d;
    --bg-topbar: #061727;
    --bg-card: #0a2639;
    --bg-card-hover: #0d2d43;
    --bg-input: #071e30;
    --bg-soft: #0b2234;
    /* Bordas */
    --border: #174057;
    --border-soft: #12374c;
    --border-hover: #22617d;
    /* Textos */
    --text-primary: #ffffff;
    --text-secondary: #b8cad5;
    --text-muted: #7192a5;
    --text-dark-muted: #4f7489;
    /* Identidade */
    --cyan: #00ded7;
    --cyan-dark: #0d747b;
    --blue: #2485e6;
    --green: #24d98a;
    --red: #ff4859;
    --yellow: #ffb632;
    --purple: #8941df;
    /* Estados */
    --success: #20dc89;
    --danger: #ff4859;
    --warning: #ffb632;
    --info: #3c9eff;
    /* Tamanhos */
    --sidebar-width: 255px;
    --sidebar-collapsed-width: 76px;
    --topbar-height: 110px;
    /* Radius */
    --radius-small: 6px;
    --radius: 10px;
    --radius-large: 14px;
    /* Sombras */
    --shadow-small: 0 3px 10px rgba(0, 0, 0, .12);
    --shadow-card: 0 8px 25px rgba(0, 0, 0, .08);
    /* Transições */
    --transition: .18s ease;
}


/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg-main);
    scroll-behavior: smooth;
}

body {
    overflow: hidden;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ============================================================
   BLAZOR ROOT
   ============================================================ */

#app {
    width: 100%;
    height: 100%;
}


/* ============================================================
   ELEMENTOS BÁSICOS
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

    h1:focus {
        outline: none;
    }

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

img,
svg {
    max-width: 100%;
}


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

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

    a:link,
    a:visited,
    a:hover,
    a:active {
        color: inherit;
        text-decoration: none;
    }


/* ============================================================
   SELEÇÃO DE TEXTO
   ============================================================ */

::selection {
    background: rgba(0, 222, 215, .25);
    color: #ffffff;
}


/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */

* {
    scrollbar-width: thin;
    scrollbar-color: #47687b transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 20px;
    background: #47687b;
    background-clip: padding-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #5c7f92;
        background-clip: padding-box;
    }


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

button {
    border: 0;
    outline: none;
}

    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 2px solid rgba(0, 222, 215, .65);
        outline-offset: 2px;
    }


/* ============================================================
   BOTÃO PRINCIPAL
   ============================================================ */

.btn-primary {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--cyan);
    border-radius: 8px;
    background: var(--cyan);
    color: #03202b !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-primary:hover {
        filter: brightness(1.07);
        transform: translateY(-1px);
    }


/* ============================================================
   BOTÃO SECUNDÁRIO
   ============================================================ */

.btn-secondary {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary) !important;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-secondary:hover {
        border-color: var(--border-hover);
        background: var(--bg-card-hover);
        color: #ffffff !important;
    }


/* ============================================================
   BOTÃO DE PERIGO
   ============================================================ */

.btn-danger {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 72, 89, .35);
    border-radius: 8px;
    background: rgba(255, 72, 89, .1);
    color: #ff6c79 !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-danger:hover {
        background: rgba(255, 72, 89, .18);
    }


/* ============================================================
   INPUTS / SELECT / TEXTAREA
   ============================================================ */

.form-control,
.form-select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 12px;
    transition: var(--transition);
}

    textarea,
    textarea.form-control {
        min-height: 100px;
        padding-top: 11px;
        padding-bottom: 11px;
        resize: vertical;
    }

        .form-control:hover,
        .form-select:hover,
        input:hover,
        select:hover,
        textarea:hover {
            border-color: #23566f;
        }

        .form-control:focus,
        .form-select:focus,
        input:focus,
        select:focus,
        textarea:focus {
            border-color: var(--cyan);
            box-shadow: 0 0 0 3px rgba(0, 222, 215, .08);
        }


        /* ============================================================
   PLACEHOLDER
   ============================================================ */

        input::placeholder,
        textarea::placeholder {
            color: #4e7185;
            opacity: 1;
        }


/* ============================================================
   LABELS
   ============================================================ */

label,
.form-label {
    display: block;
    margin-bottom: 7px;
    color: #a8bdc9;
    font-size: 11px;
    font-weight: 500;
}


/* ============================================================
   CAMPOS DESABILITADOS
   ============================================================ */

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    opacity: .55;
    cursor: not-allowed;
}


/* ============================================================
   CHECKBOX
   ============================================================ */

input[type="checkbox"] {
    accent-color: var(--cyan);
}


/* ============================================================
   VALIDAÇÃO
   ============================================================ */

.valid.modified:not([type="checkbox"]) {
    border-color: var(--success);
    outline: none;
}

.invalid {
    border-color: var(--danger) !important;
    outline: none;
}

.validation-message {
    margin-top: 5px;
    color: #ff6b77;
    font-size: 10px;
}


/* ============================================================
   ESTRUTURA PADRÃO DAS PÁGINAS
   ============================================================ */

.page-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 26px;
}


/* ============================================================
   CABEÇALHO PADRÃO DAS PÁGINAS
   ============================================================ */

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

.page-header-left {
    min-width: 0;
}

.page-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--cyan);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: #ffffff;
    font-size: 25px;
    line-height: 1.2;
    font-weight: 600;
}

.page-description {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 11px;
}


/* ============================================================
   CARD PADRÃO
   ============================================================ */

.system-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.system-card-header {
    min-height: 53px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--border-soft);
}

.system-card-title {
    margin: 0;
    color: #eaf2f6;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.system-card-body {
    padding: 20px;
}


/* ============================================================
   GRID PADRÃO
   ============================================================ */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}


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

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.form-group {
    min-width: 0;
}

    .form-group.full {
        grid-column: 1 / -1;
    }

.form-actions {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}


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

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.system-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    color: var(--text-secondary);
    font-size: 11px;
}

    .system-table thead {
        background: #081f31;
    }

    .system-table th {
        height: 43px;
        padding: 0 14px;
        border-bottom: 1px solid var(--border);
        color: #7799ab;
        font-size: 9px;
        font-weight: 600;
        letter-spacing: .4px;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .system-table td {
        height: 48px;
        padding: 0 14px;
        border-bottom: 1px solid #123448;
        color: #b9cbd5;
        white-space: nowrap;
    }

    .system-table tbody tr {
        transition: background var(--transition);
    }

        .system-table tbody tr:hover {
            background: rgba(255, 255, 255, .018);
        }

        .system-table tbody tr:last-child td {
            border-bottom: 0;
        }


/* ============================================================
   BADGES
   ============================================================ */

.badge {
    min-height: 23px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 600;
}

.badge-success {
    background: rgba(32, 220, 137, .1);
    color: #31dc91;
}

.badge-danger {
    background: rgba(255, 72, 89, .1);
    color: #ff6675;
}

.badge-warning {
    background: rgba(255, 182, 50, .1);
    color: #ffc151;
}

.badge-info {
    background: rgba(60, 158, 255, .1);
    color: #61adff;
}


/* ============================================================
   ESTADO VAZIO
   ============================================================ */

.empty-state {
    min-height: 180px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 222, 215, .08);
    color: var(--cyan);
    font-size: 20px;
}

.empty-state strong {
    color: #d8e4ea;
    font-size: 12px;
}

.empty-state p {
    max-width: 400px;
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 10px;
}


/* ============================================================
   DIVISOR
   ============================================================ */

.system-divider {
    width: 100%;
    height: 1px;
    margin: 20px 0;
    background: var(--border-soft);
}


/* ============================================================
   TEXTO AUXILIAR
   ============================================================ */

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}


/* ============================================================
   BLAZOR ERROR BOUNDARY
   ============================================================ */

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.7rem;
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYg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m9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Ocorreu um erro inesperado.";
    }


/* ============================================================
   BOOTSTRAP / BLAZOR
   ============================================================ */

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}


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

@media (max-width: 1100px) {

    .page-container {
        padding: 22px;
    }

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

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


@media (max-width: 750px) {

    .page-container {
        padding: 16px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-title {
        font-size: 21px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

        .form-actions button,
        .form-actions a {
            width: 100%;
        }
}
