* {
    box-sizing: border-box;
}

:root {
    --blue: #1769e0;
    --blue-dark: #0b397a;
    --text: #172033;
    --muted: #7b88a4;
    --line: #cbd6e6;
    --bg: #f5f8fc;
}

html {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: var(--text);
}

body {
    margin: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(23,105,224,.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(23,105,224,.13), transparent 32%),
        var(--bg);
}

.login-shell {
    width: min(1000px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .14);
}

.login-brand {
    position: relative;
    display: grid;
    place-items: center;
    padding: 48px;
    overflow: hidden;
    background: #f2f7fd;
}

.login-brand::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(23,105,224,.045);
}

.login-brand img {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    height: auto;
    object-fit: contain;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 62px 64px 28px;
}

.login-content {
    width: 100%;
    max-width: 370px;
    margin: auto;
}

.login-content h1 {
    margin: 0;
    color: var(--blue-dark);
    font-size: 30px;
    line-height: 1.15;
}

.login-subtitle {
    margin: 12px 0 30px;
    color: var(--muted);
    font-size: 14px;
}

.login-field {
    display: block;
    margin-top: 18px;
}

.login-field > span {
    display: block;
    margin-bottom: 7px;
    color: #16365f;
    font-size: 13px;
    font-weight: 800;
}

.login-field input {
    width: 100%;
    height: 51px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.login-field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23,105,224,.11);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.password-toggle:hover {
    background: #eef3f9;
}

.login-button {
    width: 100%;
    height: 50px;
    margin-top: 26px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #1d70e8, #1758bd);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(23,105,224,.18);
}

.login-button:hover {
    filter: brightness(.98);
}

.login-footer {
    margin-top: auto;
    padding-top: 35px;
    color: #8a9ab7;
    text-align: center;
    font-size: 11px;
}

@media (max-width: 760px) {
    .login-page {
        padding: 16px;
    }

    .login-shell {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: 190px;
        padding: 30px;
    }

    .login-brand::before {
        width: 260px;
        height: 260px;
    }

    .login-brand img {
        width: min(310px, 90%);
    }

    .login-panel {
        padding: 34px 26px 24px;
    }

    .login-content {
        max-width: none;
    }

    .login-content h1 {
        font-size: 26px;
    }

    .login-footer {
        margin-top: 35px;
    }
}

@media (max-width: 420px) {
    .login-page {
        padding: 0;
        background: #fff;
    }

    .login-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-brand {
        min-height: 165px;
    }

    .login-panel {
        padding: 30px 22px 22px;
    }
}
.login-error {
    margin: -10px 0 18px;
    padding: 11px 13px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fef2f2;
    color: #b42318;
    font-size: 13px;
    font-weight: 700;
}
/* =========================================================
   SGEWEB MASTER - DASHBOARD
   ========================================================= */

.master-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
    color: var(--text);
}

.master-topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 26px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.master-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.master-brand img {
    width: 145px;
    height: 48px;
    object-fit: contain;
}

.master-brand span {
    padding-left: 15px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.master-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.master-user span {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.master-user a {
    color: #b42318;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.master-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
}

.master-sidebar {
    padding: 24px 14px;
    background: #fff;
    border-right: 1px solid var(--line);
}

.master-sidebar nav {
    display: grid;
    gap: 7px;
}

.master-sidebar a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 45px;
    padding: 0 14px;
    border-radius: 9px;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.master-sidebar a span {
    min-width: 24px;
    color: var(--blue);
    text-align: center;
    font-weight: 900;
}

.master-sidebar a:hover {
    background: #f2f6fc;
}

.master-sidebar a.active {
    background: #eaf2ff;
    color: var(--blue-dark);
}

.master-content {
    width: 100%;
    max-width: 1450px;
    padding: 30px;
}

.master-heading {
    margin-bottom: 24px;
}

.master-heading h1 {
    margin: 0 0 5px;
    color: #172033;
    font-size: 28px;
}

.master-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

.master-card,
.master-welcome {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.master-card {
    padding: 20px;
}

.master-card span,
.master-card small {
    display: block;
    color: var(--muted);
}

.master-card span {
    font-size: 13px;
    font-weight: 700;
}

.master-card strong {
    display: block;
    margin: 8px 0;
    color: var(--blue-dark);
    font-size: 28px;
}

.master-card small {
    font-size: 12px;
}

.master-welcome {
    margin-top: 18px;
    padding: 26px;
}

.master-welcome h2 {
    margin: 0 0 8px;
    color: var(--blue-dark);
    font-size: 20px;
}

.master-welcome p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.master-footer {
    padding: 13px 20px;
    background: #fff;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

/* Tablet */

@media (max-width: 950px) {
    .master-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Celular */

@media (max-width: 680px) {

    .master-topbar {
        padding: 9px 15px;
    }

    .master-brand img {
        width: 115px;
    }

    .master-brand span,
    .master-user span {
        display: none;
    }

    .master-layout {
        display: block;
    }

    .master-sidebar {
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow-x: auto;
    }

    .master-sidebar nav {
        display: flex;
        min-width: max-content;
        gap: 5px;
    }

    .master-sidebar a {
        min-height: 40px;
        padding: 0 12px;
        font-size: 12px;
    }

    .master-content {
        padding: 20px 16px;
    }

    .master-heading {
        margin-bottom: 17px;
    }

    .master-heading h1 {
        font-size: 24px;
    }

    .master-cards {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .master-card {
        padding: 16px;
    }

    .master-card strong {
        font-size: 24px;
    }

    .master-welcome {
        padding: 19px;
    }
}
/* =========================================================
   SGEWEB MASTER - EMPRESAS
   ========================================================= */

.master-table-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.master-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.master-table {
    width: 100%;
    border-collapse: collapse;
}

.master-table th,
.master-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #e7ecf3;
    text-align: left;
    white-space: nowrap;
}

.master-table th {
    background: #f8fafc;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.master-table td {
    color: #475467;
    font-size: 13px;
}

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

.master-table tbody tr:hover {
    background: #fafcff;
}

.master-table td strong {
    color: #253858;
}

.master-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.master-status.active {
    background: #e7f7ee;
    color: #116b3d;
}

.master-status.inactive {
    background: #feeceb;
    color: #b42318;
}

.master-empty {
    padding: 30px !important;
    color: var(--muted) !important;
    text-align: center !important;
}

@media (max-width: 680px) {

    .master-table th,
    .master-table td {
        padding: 12px 14px;
    }
}
/* =========================================================
   FORMULÁRIOS MASTER
   ========================================================= */

.master-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.master-form-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.master-form-title {
    margin-bottom: 22px;
}

.master-form-title h2 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    color: #1f2937;
}

.master-form-title p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

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

.master-field-full {
    grid-column: 1 / -1;
}

.master-form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.master-form-field span {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.master-form-field input,
.master-form-field select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #ffffff;
    font-size: 15px;
    color: #111827;
    outline: none;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.master-form-field input:focus,
.master-form-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.master-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.master-btn-primary,
.master-btn-secondary {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.master-btn-primary {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.master-btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.master-btn-secondary {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
}

.master-btn-secondary:hover {
    background: #f9fafb;
}


/* =========================================================
   FORMULÁRIO MASTER - MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .master-form-card {
        padding: 18px;
    }

    .master-form-grid {
        grid-template-columns: 1fr;
    }

    .master-field-full {
        grid-column: auto;
    }

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

    .master-btn-primary,
    .master-btn-secondary {
        width: 100%;
    }
}
/* =========================================================
   SENHA - FORMULÁRIOS MASTER
   ========================================================= */

.master-password-wrap {
    position: relative;
    width: 100%;
}

.master-form-field .master-password-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 48px 0 13px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #ffffff;
    font-size: 15px;
    color: #111827;
    outline: none;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.master-form-field .master-password-wrap input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.master-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 8px;
    background: transparent;

    color: #64748b;
    font-size: 15px;
    line-height: 1;

    cursor: pointer;
}

.master-password-toggle:hover {
    background: #eef3f9;
}
/* MENSAGEM DE SUCESSO - MASTER */
.master-success {
    width: 100%;
    margin: 0 0 20px 0;
    padding: 13px 16px;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    background: #f0fdf4;
    color: #166534;
    font-size: 14px;
    font-weight: 600;
    box-sizing: border-box;
}
/* =========================================================
   GERENCIAR EMPRESA
   ========================================================= */

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

.master-manage-card {
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.master-manage-card-wide {
    grid-column: 1 / -1;
    min-height: auto;
}

.master-manage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.master-manage-header h2 {
    margin: 0 0 6px;
    color: var(--blue-dark);
    font-size: 19px;
}

.master-manage-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

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

.master-info-item {
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e7ecf3;
    border-radius: 10px;
}

.master-info-item span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.master-info-item strong {
    display: block;
    overflow-wrap: anywhere;
    color: #253858;
    font-size: 14px;
}

.master-manage-description {
    flex: 1;
}

.master-manage-description p {
    margin: 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.6;
}

.master-access-state {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.master-access-indicator {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    margin-top: 5px;
    border-radius: 50%;
}

.master-access-indicator.active {
    background: #16a34a;
}

.master-access-indicator.inactive {
    background: #dc2626;
}

.master-access-state strong {
    display: block;
    margin-bottom: 5px;
    color: #253858;
    font-size: 14px;
}

.master-access-state p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.master-manage-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.master-btn-danger-disabled {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff7f7;
    color: #b42318;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: not-allowed;
    opacity: .65;
}

.master-back-area {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;
}


/* GERENCIAR EMPRESA - TABLET */

@media (max-width: 950px) {

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


/* GERENCIAR EMPRESA - MOBILE */

@media (max-width: 680px) {

    .master-manage-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .master-manage-card,
    .master-manage-card-wide {
        grid-column: auto;
        min-height: auto;
        padding: 18px;
    }

    .master-manage-header {
        gap: 12px;
        margin-bottom: 18px;
    }

    .master-company-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .master-manage-actions {
        justify-content: stretch;
        margin-top: 20px;
    }

    .master-manage-actions .master-btn-secondary,
    .master-manage-actions .master-btn-danger-disabled {
        width: 100%;
    }

    .master-back-area .master-btn-secondary {
        width: 100%;
    }
}