/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --error-color: #dc2626;
    --success-color: #16a34a;
    --bg-color: #1f2937;
    --text-color: #e5e7eb;
    --border-color: #374151;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --sidebar-bg: #111827;
    --main-bg: #1f2937;
    --card-bg: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0b1120; /* cinza/azul bem escuro */
    color: var(--text-color);
    line-height: 1.6;
}

/* Tela de login em tela cheia, estilo painel de controle */
.login-page {
    min-height: 100vh;
}

.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)),
        url('/sistema/public/admin/assets/images/login-bg.jpg') center/cover no-repeat;
}

.login-content {
    width: 100%;
    max-width: 420px;
    padding: 32px 24px;
}

.login-logo-area {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-text {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.login-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.02em;
    text-transform: none;
}

.login-subtitle {
    margin-top: 8px;
    margin-bottom: 18px;
    font-size: 0.95em;
    color: #cbd5e1;
    opacity: 0.85;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #e5e7eb;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #1f2937;
    border-radius: 4px; /* cantos mais retos, nao muito arredondados */
    font-size: 14px;
    background-color: #020617;
    color: #e5e7eb;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
    background-color: #020617;
}

.btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #16a34a; /* verde similar ao exemplo */
    color: #f9fafb;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #15803d;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: var(--error-color);
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

.login-button {
    margin-top: 8px;
}

.login-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: #9ca3af;
}

.login-links a {
    color: #9ca3af;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-links .divider {
    margin: 0 2px;
    opacity: 0.8;
}

.login-security {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-size: 0.85em;
    color: #9ca3af;
    opacity: 0.8;
}

/* Loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 11px;
    color: #9ca3af;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar.sidebar-loading .sidebar-nav {
    padding: 16px 0;
}

.sidebar.sidebar-loading .sidebar-nav .empty-state {
    padding: 12px 20px;
    text-align: left;
    color: #9ca3af;
    font-size: 12px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-tree-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #9ca3af;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-tree-toggle svg {
    flex-shrink: 0;
}

.sidebar-tree-toggle::after {
    content: '';
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(-45deg);
    transition: transform 0.2s;
}

.sidebar-tree.is-open > .sidebar-tree-toggle::after {
    transform: rotate(45deg);
}

.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
}

.sidebar-tree.is-open > .sidebar-submenu {
    display: block;
}

.sidebar-submenu li {
    margin-bottom: 0;
}

.sidebar-submenu a {
    padding: 10px 20px 10px 48px;
    font-size: 12px;
    color: #9ca3af;
}

.sidebar-submenu a.active {
    background: #334155;
    color: #f9fafb;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-tree-toggle:hover,
.sidebar-tree-toggle.active,
.sidebar-tree.is-open > .sidebar-tree-toggle {
    background: #374151;
    color: #f9fafb;
}

/* Icones de fallback para paginas que nao possuem SVG inline no menu */
.sidebar-nav a::before {
    content: none !important;
    display: none !important;
}

.sidebar-nav a[data-icon='dashboard']::before,
.sidebar-nav a[href$='dashboard.html']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E");
}

.sidebar-nav a[data-icon='companies']::before,
.sidebar-nav a[href$='companies.html']::before {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNicgaGVpZ2h0PScxNicgdmlld0JveD0nMCAwIDI0IDI0JyBmaWxsPSdub25lJyBzdHJva2U9JyM5Y2EzYWYnIHN0cm9rZS13aWR0aD0nMic+PHBhdGggZD0nTTE3IDIxdi0yYTQgNCAwIDAgMC00LTRINWE0IDQgMCAwIDAtNCA0djInLz48Y2lyY2xlIGN4PSc5JyBjeT0nNycgcj0nNCcvPjxwYXRoIGQ9J00yMyAyMXYtMmE0IDQgMCAwIDAtMy0zLjg3Jy8+PHBhdGggZD0nTTE2IDMuMTNhNCA0IDAgMCAxIDAgNy43NScvPjwvc3ZnPg==");
}

.sidebar-nav a[data-icon='assets']::before,
.sidebar-nav a[href$='assets.html']::before {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNicgaGVpZ2h0PScxNicgdmlld0JveD0nMCAwIDI0IDI0JyBmaWxsPSdub25lJyBzdHJva2U9JyM5Y2EzYWYnIHN0cm9rZS13aWR0aD0nMic+PHBhdGggZD0nTTIxIDE2VjhhMiAyIDAgMCAwLTEtMS43M2wtNy00YTIgMiAwIDAgMC0yIDBsLTcgNEEyIDIgMCAwIDAgMyA4djhhMiAyIDAgMCAwIDEgMS43M2w3IDRhMiAyIDAgMCAwIDIgMGw3LTRBMiAyIDAgMCAwIDIxIDE2eicvPjwvc3ZnPg==");
}

.sidebar-nav a[data-icon='tickets']::before,
.sidebar-nav a[href$='tickets.html']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.sidebar-nav a[data-icon='service-orders']::before,
.sidebar-nav a[href$='service-orders.html']::before {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNicgaGVpZ2h0PScxNicgdmlld0JveD0nMCAwIDI0IDI0JyBmaWxsPSdub25lJyBzdHJva2U9JyM5Y2EzYWYnIHN0cm9rZS13aWR0aD0nMic+PHBhdGggZD0nTTE0IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY4eicvPjxwb2x5bGluZSBwb2ludHM9JzE0IDIgMTQgOCAyMCA4Jy8+PGxpbmUgeDE9JzE2JyB5MT0nMTMnIHgyPSc4JyB5Mj0nMTMnLz48bGluZSB4MT0nMTYnIHkxPScxNycgeDI9JzgnIHkyPScxNycvPjxwb2x5bGluZSBwb2ludHM9JzEwIDkgOSA5IDggOScvPjwvc3ZnPg==");
}

.sidebar-nav a[data-icon='maintenance']::before,
.sidebar-nav a[href$='maintenance.html']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0-1.4l-1.6-1.6a1 1 0 0 0-1.4 0l-1.9 1.9 3 3z'/%3E%3Cpath d='M3 21l3.5-.7L17 9.8l-3-3L3.7 17.3z'/%3E%3Cpath d='M19 5l2 2'/%3E%3C/svg%3E");
}

.sidebar-nav a[data-icon='reports']::before,
.sidebar-nav a[href$='reports.html']::before,
.sidebar-nav a[data-icon='billing']::before,
.sidebar-nav a[href$='billing.html']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Crect x='1' y='4' width='22' height='16' rx='2' ry='2'/%3E%3Cline x1='1' y1='10' x2='23' y2='10'/%3E%3C/svg%3E");
}

.sidebar-nav a[data-icon='compliance']::before,
.sidebar-nav a[href$='compliance.html']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
}

.sidebar-nav a[data-icon='audit']::before,
.sidebar-nav a[href$='audit.html']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--card-bg);
    color: var(--text-color);
}

.sidebar-nav a svg {
    display: block;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    margin-bottom: 10px;
}

.user-info strong {
    display: block;
    font-size: 13px;
    color: var(--text-color);
}

.user-info span {
    font-size: 11px;
    color: #9ca3af;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 2px;
}

.btn-logout:hover {
    background: var(--card-bg);
    color: var(--error-color);
    border-color: var(--error-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    background: var(--main-bg);
}

/* Header */
.header {
    background: var(--sidebar-bg);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.quick-action-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.quick-action-hint {
    font-size: 11px;
    color: #9ca3af;
    opacity: 0.85;
    line-height: 1.2;
}

.notification-widget {
    position: relative;
}

.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.notification-bell:hover {
    border-color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.notification-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(420px, 85vw);
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 30;
}

.notification-dropdown.open {
    display: block;
}

.notification-dropdown-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.notification-mark-all {
    border: 0;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

.notification-mark-all:hover {
    background: rgba(16, 185, 129, 0.12);
}

.notification-list {
    max-height: 380px;
    overflow: auto;
}

.notification-empty {
    padding: 20px 12px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(59, 130, 246, 0.08);
}

.notification-item.is-read {
    opacity: 0.72;
}

.notification-item-content {
    min-width: 0;
}

.notification-item-title {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.notification-item-text {
    margin: 0;
    font-size: 12px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.notification-item-time {
    color: #94a3b8;
    font-size: 11px;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 6px;
    flex-shrink: 0;
}

.notification-dot-info {
    background: #0ea5e9;
}

.notification-dot-warning {
    background: #f59e0b;
}

.notification-dot-critical {
    background: #ef4444;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
}

.dashboard-section {
    margin-top: 24px;
    margin-bottom: 16px;
}

.dashboard-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    padding: 0 24px;
    margin-bottom: 12px;
}

.stats-grid-kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 2px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card-kpi {
    padding: 14px;
    border-left: 3px solid transparent;
}

.stat-card-kpi .stat-info h3 {
    margin-bottom: 2px;
}

.stat-subtitle {
    font-size: 11px;
    color: #9ca3af;
    opacity: 0.9;
    margin-top: 2px;
}

.stat-health {
    border-left-color: #16a34a;
}

.stat-attention {
    border-left-color: #f59e0b;
}

.stat-critical {
    border-left-color: #ef4444;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: var(--sidebar-bg);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.stat-info h3 {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
}

/* Recent Activity */
.recent-activity {
    padding: 0 24px 24px;
}

.recent-activity h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.activity-list {
    background: var(--card-bg);
    border-radius: 2px;
    padding: 10px;
    box-shadow: var(--shadow);
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 28px;
    height: 28px;
    background: var(--sidebar-bg);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.activity-content p {
    font-size: 13px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.activity-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 1px;
}

.activity-content small {
    font-size: 11px;
    color: #9ca3af;
}

.operational-overview {
    padding: 0 24px 24px;
}

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

.operational-card {
    background: var(--card-bg);
    border-radius: 2px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.operational-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.operational-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.operational-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #cbd5e1;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.operational-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.operational-item strong {
    color: var(--text-color);
    font-size: 15px;
}

.empty-state {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 13px;
}

/* Filters Bar */
.filters-bar {
    padding: 16px 24px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.filter-group {
    flex: 1;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 13px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Table */
.table-container {
    padding: 16px 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.data-table thead {
    background: var(--sidebar-bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: var(--sidebar-bg);
}

.companies-page .table-container {
    padding-top: 12px;
}

.companies-page .table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.companies-page .results-info {
    font-size: 12px;
    color: #9ca3af;
}

.companies-page .companies-toast {
    font-size: 12px;
    color: #d1fae5;
    background: #065f46;
    border: 1px solid #10b981;
    border-radius: 4px;
    padding: 5px 8px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.companies-page .companies-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.companies-page .companies-toast.tone-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.companies-page .companies-toast.tone-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.companies-page .companies-toast.tone-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.companies-page .companies-state {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 24px;
    text-align: center;
    margin-bottom: 10px;
}

.companies-page .companies-state-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.companies-page .companies-state-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.companies-page .companies-state-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.companies-page .data-table th,
.companies-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.companies-page .company-name {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.companies-page .company-plan {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 11px;
    color: #cbd5e1;
}

.companies-page .companies-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.companies-page .action-btn {
    margin-right: 0;
}

.companies-page .action-btn.btn-copy {
    border-color: #64748b;
    color: #cbd5e1;
}

.companies-page .company-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.companies-page .company-detail-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.companies-page .company-detail-item strong {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.companies-page .company-detail-item span {
    font-size: 13px;
    color: var(--text-color);
    word-break: break-word;
}

.tickets-page .table-container {
    padding-top: 12px;
    margin-bottom: 16px;
}

.tickets-page .tickets-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tickets-page .tickets-results-info {
    font-size: 12px;
    color: #9ca3af;
}

.tickets-page .tickets-inline-message {
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tickets-page .tickets-inline-message.is-visible {
    opacity: 1;
}

.tickets-page .tickets-inline-message.tone-success {
    color: #86efac;
}

.tickets-page .tickets-inline-message.tone-error {
    color: #fecaca;
}

.tickets-page .tickets-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
}

.tickets-page .tickets-state-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.tickets-page .tickets-state-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.tickets-page .tickets-state-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.tickets-page .data-table th,
.tickets-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.tickets-page .data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.22);
}

.tickets-page .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.58);
}

.tickets-page .ticket-subject {
    display: inline-block;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.tickets-page .badge-priority-low {
    background: #475569;
    color: #e2e8f0;
}

.tickets-page .badge-priority-medium {
    background: #334155;
    color: #e2e8f0;
}

.tickets-page .badge-priority-high {
    background: #92400e;
    color: #fef3c7;
}

.tickets-page .badge-priority-critical {
    background: #991b1b;
    color: #fee2e2;
}

.tickets-page .action-btn {
    margin-right: 0;
}

.service-orders-page .data-table th,
.service-orders-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.service-orders-page .data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.22);
}

.service-orders-page .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.58);
}

.service-order-modal-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-order-modal-subtitle {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.service-orders-page .form-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
}

.service-orders-page .field-error {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #fecaca;
}

.service-orders-page .form-error-inline {
    margin-top: -4px;
    margin-bottom: 12px;
    border: 1px solid #7f1d1d;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.service-orders-page #serviceOrderSubmitBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.service-orders-page .service-order-submit-spinner {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: service-orders-spin 0.8s linear infinite;
}

.service-orders-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.service-orders-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.service-orders-toast.tone-success {
    background: #065f46;
    border: 1px solid #10b981;
    color: #d1fae5;
}

.service-orders-toast.tone-error {
    background: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fecaca;
}

@keyframes service-orders-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tickets-modal-header-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tickets-modal-subtitle {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.tickets-page .ticket-description-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tickets-page .ticket-char-counter {
    font-size: 11px;
    color: #9ca3af;
}

.tickets-page .field-error {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #fecaca;
}

.tickets-page .form-error-inline {
    margin-top: -4px;
    margin-bottom: 12px;
    border: 1px solid #7f1d1d;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.tickets-page #ticketSubmitBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tickets-page .ticket-submit-spinner {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: tickets-spin 0.8s linear infinite;
}

.tickets-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tickets-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tickets-toast.tone-success {
    background: #065f46;
    border: 1px solid #10b981;
    color: #d1fae5;
}

.tickets-toast.tone-error {
    background: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fecaca;
}

@keyframes tickets-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.assets-page .assets-overview-grid {
    padding-top: 16px;
    padding-bottom: 16px;
}

.assets-page .assets-overview-grid .stat-card {
    padding: 12px;
    min-height: 84px;
}

.assets-page .assets-overview-grid .stat-card .stat-value {
    font-size: 28px;
    line-height: 1.1;
    margin-top: 2px;
}

.assets-page .assets-overview-grid .stat-card .stat-subtitle {
    opacity: 0.7;
}

.assets-page .assets-overview-grid .stat-card-kpi {
    border-left: 3px solid transparent;
}

.assets-page .assets-overview-grid .stat-card-kpi.is-kpi-alert {
    border-left-color: #f59e0b;
}

.assets-page .assets-overview-grid .stat-card-kpi.is-kpi-critical {
    border-left-color: #ef4444;
}

.assets-page .table-container {
    padding-top: 12px;
    margin-bottom: 16px;
}

.assets-page .assets-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.assets-page .assets-results-info {
    font-size: 12px;
    color: #9ca3af;
}

.assets-page .assets-operational-hint {
    font-size: 12px;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.assets-page .assets-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
    min-height: 120px;
}

.assets-page .assets-state-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.assets-page .assets-state-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.assets-page .assets-state-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.assets-page .data-table th,
.assets-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.assets-page .data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.22);
}

.assets-page .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.58);
}

.assets-page .data-table tbody tr.asset-row-overdue {
    background: rgba(127, 29, 29, 0.2);
}

.assets-page .data-table tbody tr.asset-row-overdue:hover {
    background: rgba(127, 29, 29, 0.28);
}

.assets-page .asset-name {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.assets-page .asset-name-link {
    color: #dbeafe;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}

.assets-page .asset-name-link:hover {
    color: #93c5fd;
    border-bottom-color: rgba(147, 197, 253, 0.6);
}

.assets-page .asset-last-os {
    font-size: 12px;
    color: #cbd5e1;
}

.assets-page .asset-last-os-link {
    color: #93c5fd;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}

.assets-page .asset-last-os-link:hover {
    border-bottom-color: rgba(147, 197, 253, 0.6);
}

.assets-page .asset-maintenance-near {
    color: #fca5a5;
    font-weight: 600;
}

.assets-page .asset-maintenance-overdue {
    color: #fca5a5;
    font-weight: 700;
}

.assets-page .maintenance-warning-icon {
    margin-right: 4px;
}

.assets-page .assets-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}

.assets-page .action-btn {
    margin-right: 0;
}

.assets-page .assets-action-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.assets-page .assets-actions-menu-wrap {
    position: relative;
    flex: 0 0 auto;
}

.assets-page .data-table th:last-child,
.assets-page .data-table td:last-child {
    white-space: nowrap;
    min-width: 170px;
}

.assets-page .assets-actions-menu-toggle {
    min-width: 30px;
    padding: 6px 8px;
    font-weight: 700;
}

.assets-page .assets-actions-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 150px;
    z-index: 20;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
    padding: 4px;
    display: none;
}

.assets-page .assets-actions-menu.is-open {
    display: block;
}

.assets-page .assets-actions-menu button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 12px;
    padding: 7px 9px;
    border-radius: 3px;
    cursor: pointer;
}

.assets-page .assets-actions-menu button:hover {
    background: rgba(51, 65, 85, 0.8);
}

.assets-page .assets-actions-menu button.is-danger {
    color: #fecaca;
}

.assets-page .action-btn.btn-copy {
    border-color: #64748b;
    color: #cbd5e1;
}

.asset-category-inline-actions {
    margin-top: 8px;
}

.asset-category-create {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
}

.asset-category-create input {
    width: 100%;
    margin-bottom: 8px;
}

.asset-category-create-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-xs {
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
}

.audit-page .filters-bar {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) repeat(6, minmax(130px, 1fr));
    gap: 10px;
    align-items: center;
}

.audit-page .table-container {
    padding-top: 12px;
}

.audit-page .audit-inline-message {
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.42);
    color: #cbd5e1;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.audit-page .audit-inline-message.tone-error {
    border-color: #dc2626;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
}

.audit-page .audit-inline-message.tone-warning {
    border-color: #92400e;
    background: rgba(146, 64, 14, 0.2);
    color: #fef3c7;
}

.audit-page .audit-inline-message.tone-success {
    border-color: #10b981;
    background: rgba(6, 95, 70, 0.22);
    color: #d1fae5;
}

.audit-page .data-table tbody tr.audit-log-row {
    cursor: pointer;
}

.audit-page .data-table tbody tr.audit-log-row:hover {
    background: rgba(30, 41, 59, 0.58);
}

.audit-page .log-view pre {
    max-height: 200px;
    overflow: auto;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    font-size: 11px;
}

.assets-page .badge-overdue {
    margin-left: 6px;
    background: #991b1b;
    color: #fee2e2;
    font-size: 10px;
    padding: 2px 6px;
}

.assets-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    background: #065f46;
    border: 1px solid #10b981;
    color: #d1fae5;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.assets-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.maintenance-page .table-container {
    padding-top: 12px;
    margin-bottom: 16px;
}

.maintenance-page .maintenance-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.maintenance-page .maintenance-table-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.maintenance-page .maintenance-results-info {
    font-size: 12px;
    color: #9ca3af;
}

.maintenance-page .maintenance-empty-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 18px;
    text-align: center;
    margin-bottom: 10px;
}

.maintenance-page .maintenance-empty-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.maintenance-page .maintenance-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.maintenance-page .maintenance-empty-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.maintenance-page .maintenance-empty-state .btn {
    width: auto;
    min-width: 200px;
}

.maintenance-page .data-table th,
.maintenance-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.maintenance-page .data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.22);
}

.maintenance-page .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.58);
}

.maintenance-page .data-table tbody tr.maintenance-row-overdue {
    background: rgba(127, 29, 29, 0.18);
}

.maintenance-page .data-table tbody tr.maintenance-row-overdue:hover {
    background: rgba(127, 29, 29, 0.26);
}

.maintenance-page .maintenance-overdue-badge {
    margin-left: 6px;
    font-size: 10px;
    padding: 2px 6px;
}

.maintenance-page .maintenance-file-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.maintenance-page #contractForm .form-section {
    margin-top: 14px;
    margin-bottom: 12px;
}

.maintenance-page #contractForm .section-title {
    margin-bottom: 10px;
}

.maintenance-page #contractForm .form-grid {
    gap: 12px 16px;
}

.maintenance-page #contractForm .form-group {
    margin-bottom: 10px;
}

.maintenance-page #contractForm textarea {
    min-height: 84px;
}

.maintenance-page .maintenance-checkbox-group {
    margin-top: 2px;
}

.maintenance-page .maintenance-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #cbd5e1;
}

.maintenance-page .maintenance-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.maintenance-page .maintenance-file-actions-row {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 6px;
    padding-top: 10px;
}

.maintenance-page .form-error-inline {
    margin-top: -4px;
    margin-bottom: 12px;
    border: 1px solid #7f1d1d;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.maintenance-page #contractSubmitBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.maintenance-page .maintenance-submit-spinner {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: maintenance-spin 0.8s linear infinite;
}

.maintenance-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.maintenance-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.maintenance-toast.tone-success {
    background: #065f46;
    border: 1px solid #10b981;
    color: #d1fae5;
}

.maintenance-toast.tone-error {
    background: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fecaca;
}

.reports-page .filters-bar {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(120px, 1fr));
    gap: 10px;
    align-items: center;
}

.reports-page .table-container {
    padding-top: 12px;
    margin-bottom: 16px;
}

.reports-page .reports-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.reports-page .reports-table-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.reports-page .reports-results-info {
    font-size: 12px;
    color: #9ca3af;
}

.reports-inline-message,
.reports-page .reports-inline-message {
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.42);
    color: #cbd5e1;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.reports-inline-message.tone-success,
.reports-page .reports-inline-message.tone-success {
    border-color: #10b981;
    background: rgba(6, 95, 70, 0.22);
    color: #d1fae5;
}

.reports-inline-message.tone-error,
.reports-page .reports-inline-message.tone-error {
    border-color: #dc2626;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
}

.reports-inline-message.tone-warning {
    border-color: #f59e0b;
    background: rgba(120, 53, 15, 0.2);
    color: #fde68a;
}

.reports-inline-message.tone-info {
    border-color: var(--border-color);
    background: rgba(15, 23, 42, 0.42);
    color: #cbd5e1;
}

.reports-page .reports-empty-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 18px;
    text-align: center;
    margin-bottom: 10px;
}

.reports-page .reports-empty-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.reports-page .reports-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.reports-page .reports-empty-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.reports-page .reports-empty-state .btn {
    width: auto;
    min-width: 200px;
}

.reports-page .reports-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.reports-page .reports-form-message {
    margin-bottom: 12px;
    border: 1px solid #7f1d1d;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.reports-page .data-table th,
.reports-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.reports-page .data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.22);
}

.reports-page .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.58);
}

.compliance-page .table-container {
    padding-top: 12px;
    margin-bottom: 16px;
}

.compliance-page .compliance-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.compliance-page .compliance-table-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.compliance-page .compliance-results-info {
    font-size: 12px;
    color: #9ca3af;
}

.compliance-page .compliance-inline-message {
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.42);
    color: #cbd5e1;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

.compliance-page .compliance-inline-message.tone-success {
    border-color: #10b981;
    background: rgba(6, 95, 70, 0.22);
    color: #d1fae5;
}

.compliance-page .compliance-inline-message.tone-error {
    border-color: #dc2626;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
}

.compliance-page .compliance-empty-state {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 18px;
    text-align: center;
    margin-bottom: 10px;
}

.compliance-page .compliance-empty-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.compliance-page .compliance-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.compliance-page .compliance-empty-text {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.compliance-page .compliance-empty-state .btn {
    width: auto;
    min-width: 200px;
}

.compliance-page .data-table th,
.compliance-page .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.compliance-page .data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.22);
}

.compliance-page .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.58);
}

.compliance-page .compliance-expiry-hint {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    color: #9ca3af;
}

.compliance-page .compliance-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.compliance-page .compliance-form-message {
    margin-bottom: 12px;
    border: 1px solid #7f1d1d;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 12px;
}

@keyframes maintenance-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 2px;
}

.badge-active {
    background: #065f46;
    color: #d1fae5;
}

.badge-inactive {
    background: #374151;
    color: #9ca3af;
}

.badge-maintenance {
    background: #92400e;
    color: #fef3c7;
}

.badge-decommissioned {
    background: #991b1b;
    color: #fecaca;
}

.badge-suspended {
    background: #991b1b;
    color: #fecaca;
}

.badge-valid {
    background: #065f46;
    color: #d1fae5;
}

.badge-warning {
    background: #92400e;
    color: #fef3c7;
}

.badge-expiring {
    background: #92400e;
    color: #fef3c7;
}

.badge-expired {
    background: #991b1b;
    color: #fecaca;
}

.badge-success {
    background: #065f46;
    color: #d1fae5;
}

.badge-muted {
    background: #374151;
    color: #9ca3af;
}

.badge-danger {
    background: #991b1b;
    color: #fecaca;
}

.badge-criticality-high {
    background: #b91c1c;
    color: #ffffff;
}

.badge-criticality-medium {
    background: #ca8a04;
    color: #ffffff;
}

.badge-criticality-low {
    background: #475569;
    color: #ffffff;
}

.badge-draft {
    background: #475569;
    color: #e2e8f0;
}

.badge-pending_review {
    background: #92400e;
    color: #fef3c7;
}

.badge-approved {
    background: #065f46;
    color: #d1fae5;
}

.badge-rejected {
    background: #991b1b;
    color: #fecaca;
}

.badge-inspection {
    background: #1d4ed8;
    color: #dbeafe;
}

.badge-compliance {
    background: #4338ca;
    color: #e0e7ff;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    background: var(--sidebar-bg);
    color: var(--text-color);
    border-radius: 2px;
    cursor: pointer;
    margin-right: 4px;
}

.action-btn:hover {
    background: var(--card-bg);
}

.btn-edit {
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-delete {
    border-color: #dc2626;
    color: #dc2626;
}

/* Pagination */
.pagination {
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.btn-secondary {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--card-bg);
}

/* Modal Enterprise - SaaS B2B Premium */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-enterprise {
    background: var(--card-bg);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* Form Sections */
.form-section {
    margin-bottom: 32px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.modal-body .form-section {
    margin-top: 20px;
    margin-bottom: 16px;
}

.modal-body .form-section:first-of-type {
    margin-top: 0;
}

.modal-body .form-group {
    margin-bottom: 12px;
}

.section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.modal-body .section-divider {
    margin: 20px 0;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
    opacity: 0.85;
    margin-bottom: 12px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-col-6 {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
}

/* Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-full {
    grid-template-columns: 1fr;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    height: 44px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.text-muted {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.text-warning {
    margin-top: 6px;
    font-size: 12px;
    color: #f59e0b;
}

.toggle-grid {
    gap: 14px;
}

.toggle-group {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
}

.toggle-buttons {
    display: inline-flex;
    gap: 8px;
    margin-top: 4px;
}

.toggle-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: #cbd5e1;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: #64748b;
}

.toggle-btn.is-active {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    height: 44px;
    min-width: 120px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--sidebar-bg);
    border-color: #64748b;
}

.btn-primary {
    background: #10b981;
    color: white;
}

.btn-primary:hover {
    background: #059669;
}

/* Invoice modal refinements:
   keep legacy theme while improving readability, accessibility and file-upload UX. */
.invoice-modal__panel {
    max-width: 720px;
}

.invoice-modal__form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 90vh;
}

.invoice-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
}

.invoice-modal__intro {
    margin-bottom: 18px;
    font-size: 13px;
    color: #cbd5e1;
}

.invoice-modal__helper {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.invoice-modal__close:focus-visible,
.invoice-modal__file-btn:focus-visible,
.invoice-modal__upload:focus-within,
.invoice-modal__body input:focus-visible,
.invoice-modal__body select:focus-visible,
.invoice-modal__body textarea:focus-visible,
.invoice-modal__footer .btn:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.invoice-modal__upload {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px dashed #64748b;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    transition: border-color 0.2s, background-color 0.2s;
}

.invoice-modal__upload:hover {
    border-color: #94a3b8;
}

.invoice-modal__upload-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-modal__upload-title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.invoice-modal__upload-meta {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.invoice-modal__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.invoice-modal__file-btn {
    min-width: 120px;
    white-space: nowrap;
}

.invoice-modal__upload.is-error {
    border-color: #ef4444;
}

.invoice-modal__error {
    margin-top: 6px;
    font-size: 12px;
    color: #fca5a5;
    display: none;
}

.invoice-modal__error.is-visible {
    display: block;
}

.invoice-modal__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 0;
    padding: 14px 32px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
}

.invoice-modal__footer .btn {
    min-width: 138px;
}

/* View invoice modal fixes:
   scoped to #viewInvoiceModal to avoid side effects in other modals/pages. */
#viewInvoiceModal,
#viewInvoiceModal * {
    box-sizing: border-box;
}

#viewInvoiceModal .modal-enterprise {
    max-width: 780px;
    width: calc(100% - 32px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#viewInvoiceModal .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 20px;
}

#viewInvoiceModal #invoiceContent,
#viewInvoiceModal #invoiceContent * {
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

/* Action rows for NF/Boleto buttons */
#viewInvoiceModal .form-group .form-actions {
    border-top: none;
    margin-top: 10px;
    padding-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

#viewInvoiceModal .form-group .form-actions .btn {
    width: auto;
    min-width: 120px;
    height: 34px;
    padding: 8px 12px;
    font-size: 12px;
}

/* Final close action: stays visible and aligned without overflow. */
#viewInvoiceModal .modal-body > .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 16px;
    padding: 14px 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--card-bg);
    justify-content: flex-end;
}

#viewInvoiceModal .modal-body > .form-actions .btn {
    min-width: 160px;
}

/* Billing list alignment:
   keep action buttons inline and prevent full-width stretching in table cells. */
.billing-page .data-table th:last-child,
.billing-page .data-table td:last-child {
    width: 340px;
}

.billing-page .billing-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

.billing-page .billing-actions .action-btn {
    min-width: 0;
    height: 30px;
    margin: 0;
    margin-right: 0;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operational-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section-title {
        padding: 0 16px;
    }

    .stats-grid-kpi,
    .recent-activity,
    .operational-overview {
        padding-left: 16px;
        padding-right: 16px;
    }

    .audit-page .filters-bar {
        grid-template-columns: 1fr;
    }

    .reports-page .filters-bar {
        grid-template-columns: 1fr;
    }

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

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

    .modal-enterprise {
        max-width: 100%;
        border-radius: 8px;
    }

    .modal-body {
        padding: 24px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-col-6 {
        flex: 1 1 100%;
    }

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

    .invoice-modal__upload {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-modal__upload-meta {
        max-width: 100%;
    }

    .invoice-modal__file-btn {
        width: 100%;
    }

    .invoice-modal__footer {
        padding: 14px 24px;
    }

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

    #viewInvoiceModal .modal-body {
        padding-right: 16px;
    }

    #viewInvoiceModal .form-group .form-actions .btn,
    #viewInvoiceModal .modal-body > .form-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .billing-page .data-table th:last-child,
    .billing-page .data-table td:last-child {
        width: auto;
    }

    .billing-page .billing-actions .action-btn {
        min-width: 88px;
    }

    .billing-page .billing-actions {
        flex-wrap: wrap;
    }
}

/* Generic inline message helper for admin pages without module-specific feedback containers */
.admin-inline-message {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #dbe3f2;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
}

.admin-inline-message.tone-success {
    color: #166534;
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.admin-inline-message.tone-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.admin-inline-message.tone-warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}


/* Occurrences panel */
.occurrence-panel-host {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.42);
    padding: 12px;
}

.occurrence-panel {
    display: grid;
    gap: 10px;
}

.occurrence-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.occurrence-panel-subtitle {
    margin: 3px 0 0;
    color: #9ca3af;
    font-size: 12px;
}

.occurrence-inline-message {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.58);
}

.occurrence-inline-message.tone-success {
    border-color: #10b981;
    background: rgba(6, 95, 70, 0.22);
    color: #d1fae5;
}

.occurrence-inline-message.tone-error {
    border-color: #dc2626;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
}

.occurrence-inline-message.tone-warning {
    border-color: #f59e0b;
    background: rgba(146, 64, 14, 0.2);
    color: #fde68a;
}

.occurrence-list {
    display: grid;
    gap: 8px;
}

.occurrence-empty,
.occurrence-files-empty {
    border: 1px dashed #475569;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.22);
    color: #94a3b8;
    padding: 10px;
    font-size: 12px;
}

.occurrence-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.occurrence-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.occurrence-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #94a3b8;
    font-size: 12px;
}

.occurrence-item-description {
    margin: 0;
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.occurrence-upload-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.occurrence-files {
    display: grid;
    gap: 6px;
}

.occurrence-file-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--sidebar-bg);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.occurrence-file-actions {
    display: inline-flex;
    gap: 6px;
}

.occurrence-create-form {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    display: grid;
    gap: 8px;
}

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

.occurrence-actions {
    display: flex;
    justify-content: flex-end;
}

.occurrence-btn-small {
    padding: 6px 8px;
    min-height: 30px;
    font-size: 12px;
}

.occurrence-danger {
    color: #fecaca;
}

.occurrence-create-form.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 860px) {
    .occurrence-grid {
        grid-template-columns: 1fr;
    }
}

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

.ticket-interaction-pane {
    background: rgba(17, 27, 48, 0.55);
    border: 1px solid rgba(88, 110, 156, 0.35);
    border-radius: 8px;
    padding: 12px;
}

.ticket-interaction-pane h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: #dbe7ff;
}

.ticket-interaction-list {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.ticket-interaction-empty {
    color: #9eb1d6;
    font-size: 0.85rem;
    padding: 8px 0;
}

.ticket-comment-item {
    border-bottom: 1px dashed rgba(111, 145, 208, 0.35);
    padding: 8px 0;
}

.ticket-comment-item:last-child {
    border-bottom: none;
}

.ticket-comment-item header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: #9eb1d6;
}

.ticket-comment-item p {
    margin: 6px 0 0;
    color: #e7efff;
    font-size: 0.86rem;
    line-height: 1.45;
}

.ticket-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed rgba(111, 145, 208, 0.35);
    padding: 8px 0;
}

.ticket-attachment-item:last-child {
    border-bottom: none;
}

.ticket-attachment-item strong {
    display: block;
    font-size: 0.84rem;
    color: #e7efff;
}

.ticket-attachment-item small {
    display: block;
    font-size: 0.75rem;
    color: #9eb1d6;
}

.form-actions-inline {
    justify-content: flex-start;
    padding-top: 6px;
}

.ticket-convert-box {
    background: rgba(15, 24, 44, 0.7);
    border: 1px solid rgba(88, 110, 156, 0.35);
    border-radius: 8px;
    padding: 12px;
}

.ticket-convert-box h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: #dbe7ff;
}

.ticket-linked-os {
    margin-bottom: 10px;
    font-size: 0.84rem;
    color: #93f3be;
}

.ticket-linked-os a {
    color: #6eb8ff;
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .ticket-interactions-grid {
        grid-template-columns: 1fr;
    }
}
