/* Modern UI Styles - Reusable for all pages */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e1e8ed;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e1e8ed;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ec6928;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu .menu-section {
    padding: 8px 32px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 24px;
}

.sidebar-menu .menu-section:first-child {
    margin-top: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 32px;
    color: #5a6c7d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: #fff7ed;
    color: #ec6928;
    border-left-color: #ec6928;
}

.sidebar-menu .active a,
.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(236, 105, 40, 0.1) 0%, rgba(254, 152, 5, 0.05) 100%);
    color: #ec6928;
    border-left-color: #fe9805;
}

.sidebar-menu .submenu ul {
    list-style: none;
    background: #f8fafc;
    border-top: 1px solid #e1e8ed;
    border-bottom: 1px solid #e1e8ed;
}

.sidebar-menu .submenu ul a {
    padding: 8px 32px 8px 60px;
    font-size: 13px;
    border-left: none;
}

.sidebar-menu .submenu.active ul {
    display: block;
}

.sidebar-menu .submenu:not(.active) ul {
    display: none;
}

.sidebar-menu .submenu > a i.fa-chevron-down {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.sidebar-menu .submenu.active > a i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Main Content */
.main-container {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 16px 32px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #5a6c7d;
    font-size: 14px;
}

.user-info i {
    font-size: 24px;
    color: #ec6928;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #ec6928 0%, #fb7a35 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(236, 105, 40, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c2410c 0%, #ed5300 100%);
    box-shadow: 0 6px 16px rgba(236, 105, 40, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #5a6c7d;
    border: 1px solid #dfe3e8;
}

.btn-secondary:hover {
    background: #f5f7fa;
}

.btn-success {
    background: #ec6928;
    color: white;
}

.btn-success:hover {
    background: #ed5300;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

/* Form Styles */
.form-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
    margin-bottom: 24px;
}

.form-card-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e1e8ed;
}

.form-card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.form-card-body {
    padding: 32px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ec6928;
    box-shadow: 0 0 0 3px rgba(236, 105, 40, 0.1);
}

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

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

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Table Styles */
.content-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
}

.section-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.table-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input,
.filter-select,
.filter-date {
    padding: 8px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.search-input {
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus,
.filter-date:focus {
    outline: none;
    border-color: #ec6928;
    box-shadow: 0 0 0 3px rgba(236, 105, 40, 0.1);
}

.table-container {
    overflow-x: auto;
}

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

.data-table thead th {
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #5a6c7d;
    padding: 16px 24px;
    border-bottom: 1px solid #e1e8ed;
    background: #f8fafc;
}

.data-table tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

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

/* Action Buttons */
.actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a6c7d;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: #fff7ed;
    border-color: #ec6928;
    color: #ec6928;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e1e8ed;
}

.stat-card h3 {
    font-size: 13px;
    font-weight: 500;
    color: #5a6c7d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.stat-card .change {
    font-size: 13px;
    color: #ec6928;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-product {
    background: #dcfce7;
    color: #166534;
}

.badge-service {
    background: #dcfce7;
    color: #166534;
}

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

.badge-sent {
    background: #dcfce7;
    color: #166534;
}

.badge-paid {
    background: #dcfce7;
    color: #166534;
}

.badge-overdue {
    background: #fee2e2;
    color: #991b1b;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 32px;
    color: #5a6c7d;
}

.empty-state i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-container {
        margin-left: 0;
    }

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

/* Brand Unique Styles - Premium Design */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e1e8ed;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ec6928 0%, #fe9805 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(236, 105, 40, 0.15);
}

.stat-card:nth-child(odd)::before {
    background: linear-gradient(90deg, #ec6928 0%, #fb7a35 100%);
}

.stat-card:nth-child(even)::before {
    background: linear-gradient(90deg, #fe9805 0%, #ffb547 100%);
}

/* Premium Header Gradient */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    padding: 16px 32px;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Accent Colors for Badges */
.badge-paid {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.badge-sent {
    background: linear-gradient(135deg, #ec6928 0%, #fb7a35 100%);
    color: white;
}

.badge-overdue {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge-draft {
    background: linear-gradient(135deg, #fe9805 0%, #ffb547 100%);
    color: white;
}

/* Enhanced Sidebar with Brand Accent */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
    border-right: 1px solid #e1e8ed;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

/* Premium Tables */
.data-table thead th {
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #5a6c7d;
    padding: 16px 24px;
    border-bottom: 2px solid #ec6928;
    background: linear-gradient(135deg, #fff7ed 0%, #fff8f0 100%);
}

/* Animated Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Accent Button with Orange */
.btn-accent {
    background: linear-gradient(135deg, #fe9805 0%, #ffb547 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(254, 152, 5, 0.25);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #e58804 0%, #ff9f1a 100%);
    box-shadow: 0 6px 16px rgba(254, 152, 5, 0.35);
    transform: translateY(-1px);
}

/* Content Cards with Premium Design */
.content-section {
    background: white;
    border-radius: 16px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e1e8ed;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Premium Alert Styles */
.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #93c5fd;
}

/* Sellify-inspired dashboard refresh */
:root {
    --ui-bg: #f6f7f9;
    --ui-panel: #ffffff;
    --ui-border: #e7e9ee;
    --ui-text: #111315;
    --ui-muted: #6f7682;
    --ui-soft: #f2f4f7;
    --ui-green: #ec6928;
    --ui-green-dark: #c2410c;
    --ui-black: #111315;
}

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

[data-lucide] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.sidebar {
    width: 232px;
    background: var(--ui-panel);
    border-right: 1px solid var(--ui-border);
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px 14px;
    border-bottom: 1px solid var(--ui-border);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ui-black);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ui-green);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-icon [data-lucide] {
    width: 15px;
    height: 15px;
}

.sidebar-menu {
    padding: 18px 10px;
    flex: 1;
}

.sidebar-menu a {
    gap: 10px;
    padding: 10px 12px;
    color: #32373f;
    border-left: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: #fff7ed;
    color: var(--ui-green-dark);
    border-left-color: transparent;
}

.sidebar-menu .active > a {
    background: linear-gradient(90deg, var(--ui-green) 0%, #fb7a35 100%);
    color: white;
    border-left-color: transparent;
    box-shadow: 0 8px 18px rgba(236, 105, 40, 0.18);
}

.sidebar-menu .submenu ul {
    background: transparent;
    border: 0;
    padding: 4px 0 6px 28px;
}

.sidebar-menu .submenu ul a {
    padding: 8px 10px;
    background: transparent;
    border-left: 0;
    color: var(--ui-muted);
    font-size: 12px;
}

.sidebar-menu .submenu ul a [data-lucide] {
    width: 14px;
    height: 14px;
}

.sidebar-menu .submenu > a .chevron {
    margin-left: auto;
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.sidebar-menu .submenu.active > a .chevron {
    transform: rotate(180deg);
}

.sidebar-exit {
    margin-top: 10px;
}

.sidebar-summary {
    margin: 10px;
    padding: 14px;
    border-top: 1px solid var(--ui-border);
}

.sidebar-summary span {
    display: block;
    color: var(--ui-black);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sidebar-summary p {
    color: var(--ui-muted);
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.sidebar-summary a {
    min-height: 34px;
    border-radius: 6px;
    background: var(--ui-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.main-container {
    margin-left: 232px;
}

.header {
    min-height: 58px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--ui-border);
    padding: 10px 16px;
    gap: 16px;
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.header .user-info {
    margin-left: auto;
}

.header-title {
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title h1 {
    color: var(--ui-black);
    font-size: 15px;
    line-height: 1.2;
}

.header-title p,
.section-header p {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 11px;
}

.icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: white;
    color: var(--ui-black);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.user-info {
    gap: 8px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    border: 1px solid var(--ui-border);
    background: #f1f5f9;
}

.profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.avatar-button {
    width: 38px;
    height: 38px;
    padding: 2px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-button:hover,
.avatar-button:focus-visible,
.avatar-button[aria-expanded="true"] {
    border-color: var(--ui-green);
    box-shadow: 0 0 0 3px rgba(236, 105, 40, 0.12);
    outline: none;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    padding: 6px;
    background: white;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: 0 18px 36px rgba(17, 19, 21, 0.12);
    display: none;
    z-index: 1200;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown-header {
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--ui-border);
    margin-bottom: 4px;
}

.profile-dropdown-header strong,
.profile-dropdown-header span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-header strong {
    color: var(--ui-black);
    font-size: 13px;
    line-height: 1.3;
}

.profile-dropdown-header span {
    color: var(--ui-muted);
    font-size: 11px;
    margin-top: 3px;
}

.profile-dropdown a {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #32373f;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.profile-dropdown a:hover {
    background: #f4f6f8;
    color: var(--ui-black);
}

.profile-dropdown a [data-lucide] {
    width: 16px;
    height: 16px;
}

.profile-dropdown a.profile-dropdown-danger {
    color: #b42318;
}

.profile-dropdown a.profile-dropdown-danger:hover {
    background: #fef3f2;
    color: #912018;
}

.container {
    max-width: none;
    padding: 14px 16px 28px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.toolbar-spacer {
    flex: 1;
}

.btn {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: none;
}

.btn-primary {
    background: #050505;
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background: #222;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--ui-black);
    border: 1px solid var(--ui-border);
}

.dashboard-intro {
    margin-bottom: 14px;
}

.dashboard-intro h2 {
    color: var(--ui-black);
    font-size: 19px;
    font-weight: 700;
}

.dashboard-intro p {
    margin-top: 6px;
    color: var(--ui-muted);
    font-size: 12px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    padding: 16px 18px 18px 16px;
    min-height: 110px;
    box-shadow: none;
}

.stat-card::before {
    display: none;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 18px;
    width: 94px;
    height: 42px;
    background:
        radial-gradient(circle at 18% 72%, rgba(236, 105, 40, 0.16), transparent 28%),
        linear-gradient(135deg, transparent 0 20%, rgba(236, 105, 40, 0.15) 20% 52%, transparent 52%),
        linear-gradient(45deg, transparent 0 40%, rgba(236, 105, 40, 0.12) 40% 70%, transparent 70%);
    border-radius: 50%;
    opacity: 0.9;
}

.stat-card:hover {
    transform: none;
    box-shadow: 0 8px 18px rgba(17, 19, 21, 0.06);
}

.stat-card h3 {
    color: var(--ui-black);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.stat-card .value {
    color: var(--ui-black);
    font-size: 24px;
    line-height: 1.1;
    margin: 14px 0 4px;
}

.stat-card p {
    color: var(--ui-muted);
    font-size: 11px;
}

.stat-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--ui-black);
}

.stat-icon [data-lucide] {
    width: 18px;
    height: 18px;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 10px;
    margin-bottom: 14px;
}

.analytics-panel,
.content-section {
    background: white;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
}

.section-header {
    padding: 16px;
    border-bottom: 1px solid var(--ui-border);
}

.section-header h2 {
    color: var(--ui-black);
    font-size: 13px;
}

.panel-total {
    padding-left: 18px;
    border-left: 1px solid var(--ui-border);
}

.panel-total span {
    display: block;
    color: var(--ui-muted);
    font-size: 11px;
    margin-bottom: 4px;
}

.panel-total strong {
    color: var(--ui-black);
    font-size: 24px;
}

.bar-chart {
    height: 220px;
    padding: 26px 24px 18px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    align-items: end;
}

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

.bar-item span {
    width: 100%;
    max-width: 34px;
    min-height: 18px;
    border: 1px solid #c2410c;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #fb7a35, #ec6928);
}

.sidebar-summary a:hover {
    background: var(--ui-green-dark);
}

.bar-item span.empty {
    min-height: 0;
    border-color: transparent;
    background: transparent;
}

.bar-item small {
    color: var(--ui-muted);
    font-size: 10px;
}

.audit-header p {
    margin-top: 5px;
    color: var(--ui-muted);
    font-size: 12px;
}

.audit-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    padding: 24px;
    border: 1px solid rgba(236, 105, 40, 0.22);
    border-radius: 10px;
    background:
        radial-gradient(circle at 88% 18%, rgba(236, 105, 40, 0.18), transparent 28%),
        linear-gradient(135deg, #fff7ed 0%, #ffffff 54%, #ffedd5 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.audit-hero::before {
    content: "";
    position: absolute;
    inset: auto 30px -38px auto;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(236, 105, 40, 0.2);
    border-radius: 999px;
}

.audit-hero-copy,
.audit-hero-metric {
    position: relative;
    z-index: 1;
}

.audit-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(236, 105, 40, 0.1);
    color: var(--ui-green-dark);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.audit-hero h2 {
    margin: 0;
    color: var(--ui-black);
    font-size: 24px;
    line-height: 1.15;
}

.audit-hero p {
    max-width: 620px;
    margin-top: 8px;
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.6;
}

.audit-hero-metric {
    min-width: 220px;
    padding: 14px 16px;
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(8px);
}

.audit-hero-metric span,
.audit-stat-card span,
.audit-stat-card small {
    color: var(--ui-muted);
    font-size: 12px;
}

.audit-hero-metric strong {
    display: block;
    margin-top: 5px;
    color: var(--ui-black);
    font-size: 18px;
}

.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.audit-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: white;
}

.audit-stat-card::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -24px;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    background: rgba(236, 105, 40, 0.09);
}

.audit-stat-card strong {
    display: block;
    margin: 8px 0 4px;
    color: var(--ui-black);
    font-size: 28px;
    line-height: 1;
}

.audit-filters {
    background:
        linear-gradient(90deg, rgba(236, 105, 40, 0.05), transparent 42%),
        white;
}

.audit-filters-grid {
    grid-template-columns: minmax(180px, 1.1fr) minmax(190px, 1.2fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
}

.audit-filter-button {
    min-width: 112px;
}

.audit-section-header {
    padding: 18px 20px;
}

.audit-section-header h2 {
    font-size: 15px;
}

.audit-section-header p {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 12px;
}

.audit-table-container {
    border-top: 1px solid var(--ui-border);
}

.audit-table tbody td {
    vertical-align: middle;
}

.audit-date,
.audit-ip,
.audit-entity {
    color: #667085;
    font-size: 12px;
    white-space: nowrap;
}

.audit-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.audit-user span {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #101828;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.audit-user strong {
    color: var(--ui-black);
    font-size: 13px;
}

.audit-pill {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.audit-pill-module {
    background: #ecfdf3;
    color: #067647;
    border: 1px solid #abefc6;
}

.audit-pill-action {
    background: #f2f4f7;
    color: #344054;
    border: 1px solid #e4e7ec;
}

.audit-description {
    min-width: 280px;
    max-width: 520px;
    color: #20262d;
    line-height: 1.45;
}

.audit-empty-state {
    padding: 56px 24px;
}

.audit-empty-state [data-lucide] {
    width: 42px;
    height: 42px;
    color: #98a2b3;
}

.super-admin-header p {
    margin-top: 5px;
    color: var(--ui-muted);
    font-size: 12px;
}

.super-admin-container {
    display: grid;
    gap: 14px;
}

.super-admin-hero {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-radius: 10px;
    background:
        radial-gradient(circle at 88% 10%, rgba(16, 24, 40, 0.14), transparent 28%),
        linear-gradient(135deg, #101828 0%, #1f2937 58%, #0f5132 100%);
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.super-admin-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #d1fadf;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.super-admin-hero h2 {
    margin: 0;
    font-size: 25px;
    line-height: 1.1;
}

.super-admin-hero p {
    max-width: 690px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.55;
}

.super-admin-total {
    min-width: 230px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.super-admin-total span,
.super-admin-stats span,
.super-metric-grid span {
    display: block;
    color: var(--ui-muted);
    font-size: 12px;
}

.super-admin-total span {
    color: rgba(255, 255, 255, 0.64);
}

.super-admin-total strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
}

.super-admin-stats,
.super-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
}

.super-admin-stats article,
.super-metric-grid article {
    padding: 16px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: white;
}

.super-admin-stats strong,
.super-metric-grid strong {
    display: block;
    margin-top: 7px;
    color: var(--ui-black);
    font-size: 24px;
    line-height: 1.05;
}

.super-admin-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.super-company-list {
    position: sticky;
    top: 12px;
}

.super-company-items {
    max-height: calc(100vh - 210px);
    overflow: auto;
    padding: 8px;
}

.super-company-item {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.super-company-item:hover,
.super-company-item.active {
    border-color: rgba(236, 105, 40, 0.24);
    background: #fff7ed;
}

.super-company-item strong {
    color: var(--ui-black);
    font-size: 13px;
}

.super-company-item span {
    color: var(--ui-muted);
    font-size: 12px;
}

.license-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.license-active {
    background: #ecfdf3;
    color: #067647;
}

.license-ending {
    background: #fffaeb;
    color: #b54708;
}

.license-expired,
.license-suspended {
    background: #fef3f2;
    color: #b42318;
}

.license-none {
    background: #f2f4f7;
    color: #475467;
}

.super-company-detail {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.super-detail-header p {
    margin-top: 5px;
    color: var(--ui-muted);
    font-size: 12px;
}

.super-metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    padding: 16px;
}

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

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

.super-delete-license-form {
    padding: 0 16px 16px;
}

.super-plans-section {
    overflow: hidden;
}

.super-plan-create-form {
    align-items: end;
}

.super-plans-table input,
.super-plans-table select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 12px;
}

.super-plan-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 210px;
}

.super-plan-actions form {
    margin: 0;
}

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

.super-password-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.super-password-form input {
    min-width: 160px;
    min-height: 34px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    padding: 8px 10px;
}

.super-permissions-form {
    padding: 16px;
    display: grid;
    gap: 16px;
}

.super-permissions-form fieldset {
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 14px;
}

.super-permissions-form legend {
    padding: 0 6px;
    color: var(--ui-black);
    font-size: 12px;
    font-weight: 800;
}

.super-permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
}

.super-permission-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #303844;
    font-size: 12px;
    font-weight: 700;
}

.super-table-scroll {
    overflow-x: auto;
}

.super-fe-global {
    overflow: hidden;
}

.super-fe-filters {
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
    gap: 12px;
    align-items: end;
    border-bottom: 1px solid var(--ui-border);
}

.super-fe-summary {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
}

.super-fe-summary article {
    padding: 14px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fffaf5;
}

.super-fe-summary span {
    display: block;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
}

.super-fe-summary strong {
    display: block;
    margin-top: 5px;
    color: var(--ui-black);
    font-size: 22px;
}

.super-fe-alerts {
    padding: 0 16px 16px;
    display: grid;
    gap: 8px;
}

.super-fe-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.super-fe-alert.warning {
    background: #fffaeb;
    color: #b54708;
    border: 1px solid #fedf89;
}

.super-fe-alert.danger {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.fe-status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.fe-status-pill.pending {
    background: #fffaeb;
    color: #b54708;
}

.fe-status-pill.validated {
    background: #ecfdf3;
    color: #067647;
}

.fe-status-pill.rejected {
    background: #fef3f2;
    color: #b42318;
}

.fe-status-pill.unsubmitted {
    background: #f2f4f7;
    color: #475467;
}

.super-fe-message {
    min-width: 280px;
    max-width: 560px;
    line-height: 1.45;
}

.payment-panel {
    min-height: 300px;
}

.finance-summary {
    padding: 16px;
    display: grid;
    gap: 14px;
}

.finance-balance {
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.finance-balance span,
.finance-balance small,
.finance-row span {
    color: var(--ui-muted);
}

.finance-balance strong {
    display: block;
    margin: 6px 0 4px;
    font-size: 24px;
    color: var(--ui-black);
}

.finance-balance.positive {
    border-color: rgba(236, 105, 40, 0.22);
    background: rgba(236, 105, 40, 0.08);
}

.finance-balance.negative {
    border-color: rgba(240, 68, 56, 0.22);
    background: rgba(240, 68, 56, 0.08);
}

.finance-breakdown {
    display: grid;
    gap: 10px;
}

.finance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: white;
}

.finance-row strong {
    color: var(--ui-black);
    font-size: 13px;
}

.finance-row.total {
    background: #f8fafc;
}

.quick-actions {
    margin-bottom: 32px;
}

.quick-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.quick-card {
    min-height: 78px;
    padding: 14px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover {
    border-color: var(--ui-green);
    box-shadow: 0 8px 18px rgba(236, 105, 40, 0.1);
}

.quick-card > [data-lucide] {
    width: 24px;
    height: 24px;
    color: var(--ui-green-dark);
}

.quick-card h3 {
    color: var(--ui-black);
    font-size: 13px;
    margin-bottom: 4px;
}

.quick-card p {
    color: var(--ui-muted);
    font-size: 11px;
}

.ia-container [data-lucide],
.ai-panel [data-lucide] {
    width: 18px;
    height: 18px;
}

@media (max-width: 1100px) {
    .stats-grid,
    .dashboard-panels,
    .audit-stats-grid,
    .super-admin-stats,
    .super-metric-grid,
    .super-two-columns,
    .super-tabs-grid,
    .super-fe-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .super-admin-layout {
        grid-template-columns: 1fr;
    }

    .super-company-list {
        position: static;
    }

    .super-company-items {
        max-height: 360px;
    }
}

@media (max-width: 768px) {
    .main-container {
        margin-left: 0;
    }

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

    .user-info {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .stats-grid,
    .dashboard-panels,
    .audit-stats-grid,
    .audit-filters-grid,
    .super-admin-stats,
    .super-metric-grid,
    .super-two-columns,
    .super-tabs-grid,
    .super-form,
    .super-permission-grid,
    .super-fe-filters,
    .super-fe-summary {
        grid-template-columns: 1fr;
    }

    .super-admin-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
    }

    .super-admin-total {
        min-width: 0;
    }

    .super-password-form {
        align-items: stretch;
        flex-direction: column;
    }

    .audit-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
    }

    .audit-hero h2 {
        font-size: 20px;
    }

    .audit-hero-metric {
        min-width: 0;
    }

    .audit-filter-button {
        width: 100%;
    }

    .toolbar-spacer {
        display: none;
    }
}

/* ERP-wide polish for legacy pages using the shared layout */
.sidebar-menu {
    padding: 12px 10px 18px;
}

.sidebar-menu .menu-section {
    padding: 14px 12px 6px;
    color: #9aa3af;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.sidebar-menu .menu-section:first-child {
    margin-top: 0;
}

.sidebar-menu .submenu ul {
    padding-left: 22px;
}

.legacy-lucide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.is-spinning {
    animation: ui-spin 0.9s linear infinite;
}

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

.header > h1 {
    color: var(--ui-black);
    font-size: 17px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.header > h1 [data-lucide],
.header > h1 .legacy-lucide-icon {
    width: 20px;
    height: 20px;
    color: var(--ui-green-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-success {
    background: var(--ui-green);
    color: white;
}

.btn-success:hover {
    background: var(--ui-green-dark);
}

.filters-card,
.form-card,
.content-section {
    border-radius: 8px;
    border: 1px solid var(--ui-border);
    box-shadow: none;
}

.filters-card {
    background: white;
    padding: 16px;
    margin-bottom: 14px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.form-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--ui-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.form-card-header h2,
.form-card-header h3 {
    color: var(--ui-black);
    font-size: 14px;
}

.form-group label {
    color: #303844;
    font-size: 12px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea,
.search-input,
.filter-select,
.filter-date {
    min-height: 36px;
    border-color: var(--ui-border);
    border-radius: 6px;
    background: white;
    color: var(--ui-black);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-input:focus,
.filter-select:focus,
.filter-date:focus {
    border-color: var(--ui-green);
    box-shadow: 0 0 0 3px rgba(236, 105, 40, 0.12);
}

.data-table thead th {
    background: #fffaf5;
    border-bottom: 1px solid var(--ui-border);
    color: #5b6470;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.data-table tbody td {
    color: #2e3440;
    border-bottom: 1px solid #edf0f2;
}

.data-table tbody tr:hover {
    background: #fbfdfc;
}

.action-btn {
    border-color: var(--ui-border);
    border-radius: 6px;
    color: #475467;
}

.action-btn:hover {
    background: #fff7ed;
    border-color: var(--ui-green);
    color: var(--ui-green-dark);
}

.badge,
.status-badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.is-hidden {
    display: none !important;
}

