/* ==========================================
   Global Reset
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
}

/* ==========================================
   Login Page
========================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
}

.login-box {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 380px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: #1e3a5f;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5282;
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: #9ca3af;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: #2c5282;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #1e3a5f;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ==========================================
   App Layout (Sidebar + Navbar + Content)
========================================== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 240px;
    background: #1e3a5f;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon { font-size: 20px; }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left: 3px solid #4f9dde;
    font-weight: 600;
}

.nav-icon { font-size: 16px; }

.sidebar-footer {
    padding: 14px 20px;
    font-size: 11px;
    color: #94a3b8;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---------- Top Navbar ---------- */
.topbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a5f;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    font-size: 14px;
    color: #374151;
}

.topbar-logout {
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.topbar-logout:hover {
    background: #b91c1c;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.sidebar-toggle span {
    width: 22px;
    height: 2px;
    background: #1e3a5f;
    display: block;
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: 240px;
    margin-top: 60px;
    padding: 24px;
    flex: 1;
    width: 100%;
}

/* ==========================================
   Stats Cards
========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid transparent;
}

.stat-icon { font-size: 28px; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 22px; font-weight: 700; color: #111827; }
.stat-label { font-size: 12.5px; color: #6b7280; }

.stat-blue   { border-left-color: #2563eb; }
.stat-orange { border-left-color: #ea580c; }
.stat-green  { border-left-color: #16a34a; }
.stat-red    { border-left-color: #dc2626; }
.stat-yellow { border-left-color: #ca8a04; }
.stat-dark   { border-left-color: #374151; }

/* ==========================================
   Dashboard Columns / Panels
========================================== */
.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dash-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #f0f1f3;
}

.panel-header h3 { font-size: 15px; color: #1e3a5f; }
.panel-link { font-size: 13px; color: #2563eb; text-decoration: none; font-weight: 600; }
.panel-body { padding: 10px 18px 18px; }

.empty-msg {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.empty-msg-small {
    color: #9ca3af;
    font-size: 12px;
    padding: 6px 0;
}

/* ---------- Mini Table ---------- */
.mini-table { width: 100%; border-collapse: collapse; }

.mini-table th {
    text-align: left;
    font-size: 12px;
    color: #6b7280;
    padding: 8px 6px;
    border-bottom: 1px solid #f0f1f3;
}

.mini-table td {
    font-size: 13.5px;
    padding: 10px 6px;
    border-bottom: 1px solid #f7f7f8;
    color: #374151;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #cffafe; color: #0e7490; }

/* ==========================================
   Page Header
========================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h2 { font-size: 20px; color: #1e3a5f; }
.header-actions { display: flex; gap: 10px; }

/* ==========================================
   Buttons
========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-small {
    padding: 7px 12px;
    font-size: 12.5px;
}

.btn-primary { background: #2c5282; color: #fff; }
.btn-primary:hover { background: #1e3a5f; }

.btn-secondary { background: #f0f1f3; color: #1f2937; }
.btn-secondary:hover { background: #e2e4e8; }

.btn-outline { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ==========================================
   Flash Messages
========================================== */
.flash-msg {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.error-list { padding-left: 18px; }
.error-list li { margin-bottom: 2px; }

/* ==========================================
   Filter / Search Bar
========================================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    background: #fff;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: #2c5282;
}

/* ==========================================
   Data Table
========================================== */
.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table th {
    text-align: left;
    font-size: 12.5px;
    color: #6b7280;
    padding: 14px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f0f1f3;
    white-space: nowrap;
}

.data-table td {
    font-size: 13.5px;
    padding: 14px 16px;
    border-bottom: 1px solid #f7f7f8;
    color: #374151;
    vertical-align: middle;
}

.data-table tbody tr:hover { background: #f9fafb; }

.link-strong {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 600;
}

.link-strong:hover { text-decoration: underline; }

.actions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

.action-link {
    text-decoration: none;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
   
}

.inline-form { display: inline; }

/* ==========================================
   Forms
========================================== */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 720px;
}

.form-card-wide {
    max-width: 860px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

/* ==========================================
   Profile Pages (Client / Project)
========================================== */
.profile-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f1f3;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2c5282;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-name {
    font-size: 18px;
    color: #111827;
    margin-bottom: 6px;
}

.profile-badges {
    display: flex;
    gap: 8px;
}

.client-link {
    font-size: 13.5px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.client-link:hover { text-decoration: underline; }

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-full { grid-column: 1 / -1; }

.detail-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    font-weight: 600;
}

.detail-value { font-size: 14.5px; color: #1f2937; }

.detail-highlight {
    font-weight: 700;
    color: #2c5282;
}

/* ---------- Summary Cards ---------- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #2c5282;
}

.summary-label { font-size: 12.5px; color: #6b7280; }

.info-banner {
    background: #eff6ff;
    color: #1e40af;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    border: 1px solid #dbeafe;
}

/* ==========================================
   Payment Context Card
========================================== */
.payment-context-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 18px;
    font-size: 14px;
}

/* ==========================================
   Renewal Alerts (Dashboard)
========================================== */
.alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.alert-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px;
    border-left: 4px solid transparent;
}

.alert-expired { border-left-color: #dc2626; background: #fef2f2; }
.alert-today   { border-left-color: #ea580c; background: #fff7ed; }
.alert-7       { border-left-color: #ca8a04; background: #fefce8; }
.alert-15      { border-left-color: #2563eb; background: #eff6ff; }
.alert-30      { border-left-color: #16a34a; background: #f0fdf4; }

.alert-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.alert-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.alert-card-count {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.alert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 6px;
}

.alert-list a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-list a:hover { text-decoration: underline; }

.alert-days {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================
   Notes (Module 7)
========================================== */
.note-add-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    background: #f9fafb;
    padding: 14px;
    border-radius: 10px;
}

.note-add-form textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
}

.note-add-form textarea:focus {
    outline: none;
    border-color: #2c5282;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.notes-grid-inline {
    margin-top: 4px;
}

.note-card {
    background: #fefefe;
    border: 1px solid #f0f1f3;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-card-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.note-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-decoration: none;
}

.note-tag-client { background: #dbeafe; color: #1e40af; }
.note-tag-project { background: #cffafe; color: #0e7490; }

.note-text {
    font-size: 13.5px;
    color: #374151;
    line-height: 1.5;
    word-break: break-word;
}

.note-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f7f7f8;
}

.note-date {
    font-size: 11px;
    color: #9ca3af;
}

.note-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================
   Activity Feed (Dashboard)
========================================== */
.activity-feed {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #f7f7f8;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 16px;
    width: 28px;
    height: 28px;
    background: #f4f6f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
   
}

.activity-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.activity-desc {
    font-size: 13px;
    color: #374151;
    word-break: break-word;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-time {
    font-size: 11px;
    color: #9ca3af;
}

/* ==========================================
   Placeholder (kept for safety)
========================================== */
.placeholder-wrapper {
    max-width: 500px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.btn-logout {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
}

/* ==========================================
   Mobile Responsive
========================================== */
@media (max-width: 480px) {
    .login-box { padding: 30px 20px; }
}

@media (max-width: 900px) {
    .dashboard-columns { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .profile-details { grid-template-columns: 1fr; }
    .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        width: 220px;
        box-shadow: 4px 0 15px rgba(0,0,0,0.15);
    }

    .sidebar.sidebar-open { transform: translateX(0); }

    .main-content { margin-left: 0; }

    .topbar-title { font-size: 15px; }
    .topbar-user { display: none; }

    .page-header { flex-direction: column; align-items: flex-start; }
    .filter-bar { flex-direction: column; }
    .filter-input { width: 100%; }
    .profile-header { flex-direction: column; align-items: flex-start; }
    .note-add-form { flex-direction: column; }
}



/* ==========================================
   Module 9: Users, Roles & Permissions
========================================== */

.topbar-role-badge {
    margin-left: 6px;
    vertical-align: middle;
}

.access-denied-wrapper {
    max-width: 480px;
    margin: 100px auto;
    text-align: center;
    background: #fff;
    padding: 40px 30px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.access-denied-icon {
    font-size: 48px;
    margin-bottom: 12px;
   
}

.access-denied-wrapper h2 {
    color: #1e3a5f;
    margin-bottom: 10px;
}

.access-denied-wrapper p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 22px;
}

.permission-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f1f3;
}

.permission-group:last-of-type {
    border-bottom: none;
}

.permission-group-title {
    font-size: 13.5px;
    color: #1e3a5f;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #374151;
    background: #f9fafb;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.permission-checkbox input {
    width: auto;
    cursor: pointer;
}

.password-reveal-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-bottom: 18px;
}

.password-reveal-value {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #15803d;
    letter-spacing: 1px;
    margin: 8px 0;
    user-select: all;
}

.activity-actor {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .permission-grid {
        grid-template-columns: 1fr;
    }
}



/* ============================================================
   Web2F Agency Management System — Design System (Module 10)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-soft: #dbeafe;

    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --ink-300: #cbd5e1;
    --ink-200: #e2e8f0;
    --ink-100: #f1f5f9;
    --ink-50:  #f8fafc;
    --white: #ffffff;

    --green: #16a34a;
    --green-bg: #dcfce7;
    --red: #dc2626;
    --red-bg: #fee2e2;
    --yellow: #ca8a04;
    --yellow-bg: #fef9c3;
    --blue: #2563eb;
    --blue-bg: #dbeafe;
    --purple: #0e7490;
    --purple-bg: #cffafe;
    --gray-bg: #f1f5f9;

    --sidebar-width: 256px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
    --shadow-lg: 0 12px 32px rgba(15,23,42,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--ink-50);
    color: var(--ink-700);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { color: var(--ink-900); font-weight: 700; letter-spacing: -0.01em; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(circle at top left, #3b82f6 0%, #2563eb 45%, #1e3a8a 100%);
}
.login-box { background: var(--white); padding: 44px 36px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; }
.login-title { font-size: 24px; font-weight: 800; text-align: center; color: var(--ink-900); margin-bottom: 4px; }
.login-subtitle { text-align: center; color: var(--ink-500); font-size: 13.5px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-700); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; background: var(--white); color: var(--ink-900);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.field-hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--ink-400); }
.btn-login { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-login:hover { background: var(--primary-dark); }
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--red-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-info  { background: var(--blue-bg); color: #1e40af; border: 1px solid #bfdbfe; }

.app-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.app-body { display: flex; flex: 1; }

.sidebar {
    width: var(--sidebar-width); background: var(--ink-900); color: #cbd5e1; display: flex; flex-direction: column;
    position: fixed; top: var(--topbar-height); bottom: 0; left: 0; z-index: 100; transition: transform 0.25s ease;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 22px 20px; font-weight: 800; font-size: 15px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo-icon { font-size: 18px; width: 34px; height: 34px; background: var(--primary); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #64748b; padding: 14px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: #cbd5e1; text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background 0.15s, color 0.15s; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; font-size: 10.5px; color: #64748b; border-top: 1px solid rgba(255,255,255,0.08); }

.topbar { height: var(--topbar-height); background: var(--white); border-bottom: 1px solid var(--ink-200); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: fixed; top: 0; left: 0; right: 0; z-index: 200; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--ink-900); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 6px; }
.sidebar-toggle span { width: 20px; height: 2px; background: var(--ink-700); display: block; border-radius: 2px; }

.icon-btn { position: relative; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: none; border: none; cursor: pointer; font-size: 17px; color: var(--ink-500); transition: background 0.15s; }
.icon-btn:hover { background: var(--ink-100); }
.icon-badge { position: absolute; top: 4px; right: 4px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.dropdown-wrapper { position: relative; }
.dropdown-panel { display: none; position: absolute; top: 48px; right: 0; background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--ink-200); width: 320px; z-index: 300; overflow: hidden; }
.dropdown-panel.open { display: block; }
.dropdown-header { padding: 14px 16px; font-size: 13px; font-weight: 700; color: var(--ink-900); border-bottom: 1px solid var(--ink-100); }
.dropdown-body { max-height: 320px; overflow-y: auto; }
.dropdown-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ink-100); font-size: 12.5px; }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item .dropdown-icon { width: 30px; height: 30px; background: var(--ink-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.dropdown-empty { padding: 24px 16px; text-align: center; color: var(--ink-400); font-size: 12.5px; }
.dropdown-footer { padding: 10px 16px; text-align: center; font-size: 12px; font-weight: 600; color: var(--primary); border-top: 1px solid var(--ink-100); text-decoration: none; display: block; }
.dropdown-footer:hover { background: var(--ink-50); }

.profile-trigger { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; background: none; transition: background 0.15s; }
.profile-trigger:hover { background: var(--ink-100); }
.profile-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-trigger-text { text-align: left; display: none; }
.profile-trigger-name { font-size: 12.5px; font-weight: 600; color: var(--ink-900); display: block; line-height: 1.2; }
.profile-trigger-role { font-size: 10.5px; color: var(--ink-400); }
@media (min-width: 640px) { .profile-trigger-text { display: block; } }
.profile-dropdown-header { padding: 16px; border-bottom: 1px solid var(--ink-100); display: flex; align-items: center; gap: 12px; }
.profile-menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13px; color: var(--ink-700); text-decoration: none; }
.profile-menu-item:hover { background: var(--ink-50); }
.profile-menu-item.danger { color: var(--red); }

.main-content { margin-left: var(--sidebar-width); margin-top: var(--topbar-height); padding: 28px; flex: 1; width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius-md); padding: 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); transition: box-shadow 0.15s, transform 0.15s; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon { font-size: 20px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--ink-900); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.stat-blue .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat-orange .stat-icon { background: #ffedd5; color: #ea580c; }
.stat-green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-yellow .stat-icon { background: var(--yellow-bg); color: var(--yellow); }
.stat-dark .stat-icon { background: var(--ink-100); color: var(--ink-700); }

.dashboard-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-panel, .table-card, .form-card, .profile-card { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); overflow: hidden; margin-bottom: 20px; transition: box-shadow 0.15s; }
.dash-panel:hover, .table-card:hover, .profile-card:hover { box-shadow: var(--shadow-md); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--ink-100); }
.panel-header h3 { font-size: 14.5px; color: var(--ink-900); font-weight: 700; }
.panel-link { font-size: 12.5px; color: var(--primary); text-decoration: none; font-weight: 600; }
.panel-link:hover { text-decoration: underline; }
.panel-body { padding: 16px 20px 20px; }

.empty-msg { color: var(--ink-400); font-size: 13px; text-align: center; padding: 36px 20px; }
.empty-msg::before { content: '📭'; display: block; font-size: 30px; margin-bottom: 10px; }
.empty-msg-small { color: var(--ink-400); font-size: 12px; padding: 8px 0; }

.skeleton { background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-200) 37%, var(--ink-100) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-400); padding: 8px 6px; border-bottom: 1px solid var(--ink-100); }
.mini-table td { font-size: 13px; padding: 11px 6px; border-bottom: 1px solid var(--ink-50); color: var(--ink-700); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--green-bg); color: #15803d; }
.badge-gray { background: var(--ink-100); color: var(--ink-500); }
.badge-red { background: var(--red-bg); color: #b91c1c; }
.badge-yellow { background: var(--yellow-bg); color: #a16207; }
.badge-blue { background: var(--blue-bg); color: #1e40af; }
.badge-purple { background: var(--purple-bg); color: #0e7490; }

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.page-header h2 { font-size: 21px; color: var(--ink-900); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; text-decoration: none; border: none; cursor: pointer; transition: background 0.15s, box-shadow 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn-small { padding: 7px 12px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--ink-100); color: var(--ink-700); }
.btn-secondary:hover { background: var(--ink-200); }
.btn-outline { background: var(--white); color: var(--ink-700); border: 1.5px solid var(--ink-200); }
.btn-outline:hover { background: var(--ink-50); border-color: var(--ink-300); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.flash-msg { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; }
.flash-success { background: var(--green-bg); color: #15803d; border: 1px solid #bbf7d0; }
.flash-error { background: var(--red-bg); color: #b91c1c; border: 1px solid #fecaca; }
.flash-info { background: var(--blue-bg); color: #1e40af; border: 1px solid #bfdbfe; }
.error-list { padding-left: 18px; }
.error-list li { margin-bottom: 2px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; background: var(--white); padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm); }
.filter-input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm); font-size: 13.5px; }
.filter-select { padding: 10px 14px; border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm); font-size: 13.5px; background: var(--white); }
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-400); padding: 13px 16px; background: var(--ink-50); border-bottom: 1px solid var(--ink-100); white-space: nowrap; }
.data-table td { font-size: 13px; padding: 14px 16px; border-bottom: 1px solid var(--ink-50); color: var(--ink-700); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--ink-50); }
.link-strong { color: var(--ink-900); text-decoration: none; font-weight: 600; }
.link-strong:hover { color: var(--primary); }
.actions-cell { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.action-link { text-decoration: none; font-size: 15px; background: none; border: none; cursor: pointer; padding: 4px; line-height: 1; border-radius: 6px; }
.action-link:hover { background: var(--ink-100); }
.inline-form { display: inline; }

.form-card { padding: 26px; max-width: 720px; box-shadow: var(--shadow-sm); }
.form-card-wide { max-width: 880px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }

.profile-card { padding: 26px; }
.profile-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--ink-100); flex-wrap: wrap; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-name { font-size: 18px; color: var(--ink-900); margin-bottom: 6px; }
.profile-badges { display: flex; gap: 8px; }
.client-link { font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 600; }
.client-link:hover { text-decoration: underline; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-full { grid-column: 1 / -1; }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-400); font-weight: 600; }
.detail-value { font-size: 14px; color: var(--ink-900); }
.detail-highlight { font-weight: 700; color: var(--primary); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.summary-card { background: var(--white); border-radius: var(--radius-md); padding: 18px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); transition: box-shadow 0.15s; }
.summary-card:hover { box-shadow: var(--shadow-md); }
.summary-value { display: block; font-size: 20px; font-weight: 800; color: var(--primary); }
.summary-label { font-size: 12px; color: var(--ink-500); }

.info-banner { background: var(--blue-bg); color: #1e40af; padding: 14px 16px; border-radius: var(--radius-md); font-size: 13px; border: 1px solid #bfdbfe; }

.payment-context-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; background: var(--white); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100); margin-bottom: 18px; font-size: 13.5px; }

.alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.alert-card { background: var(--ink-50); border-radius: var(--radius-sm); padding: 14px; border-left: 4px solid transparent; }
.alert-expired { border-left-color: var(--red); background: #fef2f2; }
.alert-today { border-left-color: #ea580c; background: #fff7ed; }
.alert-7 { border-left-color: var(--yellow); background: #fefce8; }
.alert-15 { border-left-color: var(--blue); background: #eff6ff; }
.alert-30 { border-left-color: var(--green); background: #f0fdf4; }
.alert-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.alert-card-title { font-size: 12.5px; font-weight: 700; color: var(--ink-900); }
.alert-card-count { font-size: 17px; font-weight: 800; color: var(--ink-900); }
.alert-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.alert-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding: 6px 8px; background: var(--white); border-radius: 6px; }
.alert-list a { color: var(--ink-900); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-list a:hover { color: var(--primary); }
.alert-days { font-size: 10.5px; color: var(--ink-500); font-weight: 600; white-space: nowrap; }

.note-add-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; background: var(--ink-50); padding: 14px; border-radius: var(--radius-md); }
.note-add-form textarea { flex: 1; padding: 10px 12px; border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; resize: vertical; min-height: 44px; }
.note-add-form textarea:focus { outline: none; border-color: var(--primary); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.notes-grid-inline { margin-top: 4px; }
.note-card { background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.note-card-head { display: flex; flex-wrap: wrap; gap: 6px; }
.note-tag { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; text-decoration: none; }
.note-tag-client { background: var(--blue-bg); color: #1e40af; }
.note-tag-project { background: var(--purple-bg); color: #0e7490; }
.note-text { font-size: 13px; color: var(--ink-700); line-height: 1.5; word-break: break-word; }
.note-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--ink-50); }
.note-date { font-size: 10.5px; color: var(--ink-400); }
.note-actions { display: flex; gap: 8px; }

.activity-feed { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--ink-50); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 15px; width: 30px; height: 30px; background: var(--ink-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.activity-desc { font-size: 12.5px; color: var(--ink-700); word-break: break-word; }
.activity-meta { display: flex; align-items: center; gap: 8px; }
.activity-time { font-size: 10.5px; color: var(--ink-400); }
.activity-actor { display: block; font-size: 10.5px; color: var(--ink-400); margin-top: 2px; }

.access-denied-wrapper { max-width: 480px; margin: 100px auto; text-align: center; background: var(--white); padding: 44px 30px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--ink-100); }
.access-denied-icon { font-size: 46px; margin-bottom: 12px; }
.access-denied-wrapper h2 { color: var(--ink-900); margin-bottom: 10px; }
.access-denied-wrapper p { color: var(--ink-500); font-size: 13.5px; margin-bottom: 22px; }

.permission-group { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--ink-100); }
.permission-group:last-of-type { border-bottom: none; }
.permission-group-title { font-size: 12.5px; color: var(--ink-900); font-weight: 700; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.permission-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-700); background: var(--ink-50); padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.permission-checkbox input { width: auto; cursor: pointer; }

.password-reveal-box { background: var(--green-bg); border: 1px solid #bbf7d0; border-radius: var(--radius-md); padding: 16px; text-align: center; margin-bottom: 18px; }
.password-reveal-value { font-family: 'Courier New', monospace; font-size: 20px; font-weight: 700; color: #15803d; letter-spacing: 1px; margin: 8px 0; user-select: all; }

.placeholder-wrapper { max-width: 500px; margin: 80px auto; background: var(--white); padding: 30px; border-radius: var(--radius-md); text-align: center; box-shadow: var(--shadow-md); }
.btn-logout { display: inline-block; margin-top: 16px; padding: 10px 20px; background: var(--red); color: #fff; text-decoration: none; border-radius: var(--radius-sm); font-size: 14px; }

@media (max-width: 480px) { .login-box { padding: 32px 22px; } }
@media (max-width: 900px) { .dashboard-columns { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } .form-row-3 { grid-template-columns: 1fr; } .profile-details { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); width: 240px; box-shadow: var(--shadow-lg); }
    .sidebar.sidebar-open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 18px; }
    .topbar { padding: 0 16px; }
    .topbar-title { font-size: 14.5px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .filter-bar { flex-direction: column; }
    .filter-input { width: 100%; }
    .profile-header { flex-direction: column; align-items: flex-start; }
    .note-add-form { flex-direction: column; }
    .dropdown-panel { width: 280px; right: -8px; }
    .permission-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Module 11: Agency Settings
   ============================================================ */

.settings-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--white);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--ink-100);
    overflow-x: auto;
}

.settings-tab {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-500);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.settings-tab:hover { background: var(--ink-50); color: var(--ink-900); }
.settings-tab.active { background: var(--primary); color: #fff; }

.upload-preview-box {
    width: 100%;
    height: 90px;
    border: 1.5px dashed var(--ink-200);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: var(--ink-50);
    overflow: hidden;
}
.upload-preview-box img { max-height: 80%; max-width: 90%; object-fit: contain; }
.upload-preview-box span { font-size: 12px; color: var(--ink-400); }
.upload-preview-small { height: 60px; width: 60px; }

.settings-divider { height: 1px; background: var(--ink-100); margin: 24px 0; }

.test-email-form { display: flex; gap: 10px; flex-wrap: wrap; }
.test-email-form input {
    flex: 1; min-width: 220px; padding: 10px 14px;
    border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm); font-size: 13.5px;
}
.test-email-form input:focus { outline: none; border-color: var(--primary); }

.toggle-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ink-100);
    cursor: pointer;
    font-size: 13.5px;
    color: var(--ink-900);
    font-weight: 600;
}
.toggle-switch-row:last-of-type { border-bottom: none; }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--ink-200); transition: 0.2s; border-radius: 999px;
}
.toggle-slider::before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: 0.2s; border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

.maintenance-banner {
    background: #fef3c7;
    color: #92400e;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    padding: 8px 16px;
    margin-top: var(--topbar-height);
    position: relative;
    z-index: 150;
}
.maintenance-banner a { color: #92400e; text-decoration: underline; margin-left: 8px; }

@media (max-width: 768px) {
    .settings-tabs { flex-wrap: nowrap; }
}




/* ============================================================
   Module 12: Invoices
   ============================================================ */

.item-line-row { margin-bottom: 10px; }

.item-line-fields {
    display: grid;
    grid-template-columns: 2fr 2fr 0.7fr 1fr 0.8fr 0.8fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.item-line-fields input {
    padding: 9px 10px;
    border: 1.5px solid var(--ink-200);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    width: 100%;
}
.item-line-fields input:focus { outline: none; border-color: var(--primary); }

.item-line-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-900);
    text-align: right;
    padding-right: 4px;
}

.btn-icon-remove {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--ink-200);
    background: var(--white);
    color: var(--red);
    cursor: pointer;
    font-size: 13px;
}
.btn-icon-remove:hover { background: var(--red-bg); }

.invoice-preview-totals {
    max-width: 320px;
    margin: 16px 0 20px auto;
    background: var(--ink-50);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}
.invoice-preview-totals div {
    display: flex; justify-content: space-between; font-size: 13px;
    color: var(--ink-700); padding: 4px 0;
}
.invoice-preview-totals .invoice-grand-total {
    font-weight: 800; font-size: 15px; color: var(--ink-900);
    border-top: 1px solid var(--ink-200); margin-top: 6px; padding-top: 8px;
}

/* ---------- Printable Invoice Sheet (shared by public + admin print pages) ---------- */
.invoice-public-body { background: var(--ink-100); }

.invoice-print-wrapper { max-width: 820px; margin: 30px auto; padding: 0 16px; }

.invoice-print-actions {
    display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 16px;
}

.invoice-sheet {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    position: relative;
    overflow: hidden;
    border-top: 6px solid var(--primary);
}

.invoice-ribbon {
    position: absolute;
    top: 22px;
    right: -48px;
    width: 180px;
    transform: rotate(45deg);
    text-align: center;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 6px 0;
    color: #fff;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.invoice-ribbon-paid { background: var(--green); }
.invoice-ribbon-overdue, .invoice-ribbon-cancelled { background: var(--red); }
.invoice-ribbon-draft, .invoice-ribbon-sent, .invoice-ribbon-viewed, .invoice-ribbon-partially-paid { background: var(--yellow); }

.invoice-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; padding-bottom: 24px; border-bottom: 2px solid var(--ink-100); margin-bottom: 24px;
}
.invoice-logo { max-height: 50px; margin-bottom: 10px; }
.invoice-agency-name { font-size: 19px; margin-bottom: 6px; color: var(--primary); }
.invoice-head-left p { font-size: 12.5px; color: var(--ink-500); margin-bottom: 2px; }

.invoice-head-right { text-align: right; }
.invoice-title { font-size: 28px; letter-spacing: 3px; color: var(--primary); font-weight: 800; }
.invoice-number { font-size: 15px; font-weight: 700; color: var(--ink-900); margin: 6px 0 10px; }
.invoice-status-badge { font-size: 12px; padding: 5px 14px; }

.invoice-meta-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px;
}
.invoice-meta-box {
    background: var(--ink-50);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.invoice-meta-grid p { font-size: 13px; color: var(--ink-700); margin: 2px 0 8px; }
.invoice-client-name { font-weight: 700; font-size: 14.5px; color: var(--ink-900); }

.invoice-items-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; border-radius: var(--radius-sm); overflow: hidden; }
.invoice-items-table th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--primary); padding: 11px 10px; background: var(--primary-light); border-bottom: 1px solid var(--ink-200);
}
.invoice-items-table td { font-size: 13px; padding: 12px 10px; border-bottom: 1px solid var(--ink-50); color: var(--ink-700); }
.invoice-items-table tbody tr:nth-child(even) { background: var(--ink-50); }
.invoice-items-table small { color: var(--ink-400); }

.invoice-totals {
    max-width: 320px; margin-left: auto; margin-bottom: 28px;
    background: var(--ink-50); border-radius: var(--radius-md); padding: 16px 20px;
}
.invoice-totals-row {
    display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; color: var(--ink-700);
}
.invoice-grand-total {
    font-weight: 800; font-size: 15.5px; color: var(--white); border-top: none;
    margin-top: 8px; padding: 10px 12px; background: var(--primary); border-radius: var(--radius-sm);
}
.invoice-balance-due { font-weight: 700; color: var(--red); }

.invoice-notes { margin-bottom: 20px; }
.invoice-notes h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-400); margin-bottom: 6px; }
.invoice-notes p { font-size: 13px; color: var(--ink-700); }

.invoice-payment-box {
    background: var(--ink-50); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 20px;
}
.invoice-payment-box h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-500); margin-bottom: 8px; }
.invoice-payment-box p { font-size: 13px; color: var(--ink-700); margin-bottom: 6px; }

.invoice-footer-text { text-align: center; font-size: 11.5px; color: var(--ink-400); padding-top: 16px; border-top: 1px solid var(--ink-100); }

@media print {
    .no-print { display: none !important; }
    body.invoice-public-body { background: #fff; }
    .invoice-print-wrapper { margin: 0; padding: 0; max-width: 100%; }
    .invoice-sheet { box-shadow: none; border-radius: 0; padding: 10px; }
}

@media (max-width: 768px) {
    .item-line-fields { grid-template-columns: 1fr; }
    .invoice-head { flex-direction: column; }
    .invoice-head-right { text-align: left; }
    .invoice-meta-grid { grid-template-columns: 1fr; }
    .invoice-sheet { padding: 20px; }
}


/* ============================================================
   Module 13: Client Portal
   ============================================================ */

.stat-purple .stat-icon {
    background: var(--purple-bg);
    color: var(--purple);
}


/* ============================================================
   Module 14: Notification Center
   ============================================================ */

.notification-list { list-style: none; }

.notification-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--ink-50);
    padding: 4px 20px;
}
.notification-row:last-child { border-bottom: none; }
.notification-unread { background: var(--primary-light); }

.notification-row-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    color: inherit;
    padding: 12px 0;
    position: relative;
}

.notification-icon {
    width: 34px; height: 34px;
    background: var(--ink-100);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
   
}

.notification-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.notification-title { font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.notification-message { font-size: 12.5px; color: var(--ink-600); }
.notification-time { font-size: 11px; color: var(--ink-400); }

.notification-dot {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notification-delete-form { display: flex; align-items: center; }

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.pagination-link {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--ink-50);
    color: var(--ink-700);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
}
.pagination-link:hover { background: var(--ink-100); }
.pagination-link.active { background: var(--primary); color: #fff; }

@media (max-width: 768px) {
    .notification-row { padding: 4px 12px; }
}


/* ============================================================
   Module 15: Client Portal Entry Tabs
   ============================================================ */

.portal-entry-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--ink-100);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.portal-entry-tab {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-500);
    text-decoration: none;
}
.portal-entry-tab:hover { color: var(--ink-900); }
.portal-entry-tab.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }

@media (max-width: 400px) {
    .portal-entry-tab { font-size: 10.5px; padding: 8px 3px; }
}


/* ============================================================
   Module 16: Google Sign-In
   ============================================================ */

.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: var(--ink-400);
    font-size: 11.5px;
}
.oauth-divider::before, .oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--ink-200);
}
.oauth-divider span { padding: 0 10px; }

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    background: var(--white);
    color: var(--ink-700);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.btn-google:hover { background: var(--ink-50); border-color: var(--ink-300); }

.btn-google-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.redirect-uri-box {
    background: var(--ink-50);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    color: var(--ink-900);
    margin-bottom: 8px;
    word-break: break-all;
    user-select: all;
}


/* ============================================================
   Module 17: Dashboard Enhancements (Hero + Charts)
   ============================================================ */

.dash-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}
.dash-hero-title { color: #fff; font-size: 20px; margin-bottom: 6px; }
.dash-hero-sub { color: rgba(255,255,255,0.85); font-size: 13px; }
.dash-hero .btn-secondary { background: rgba(255,255,255,0.15); color: #fff; }
.dash-hero .btn-secondary:hover { background: rgba(255,255,255,0.25); }

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.chart-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--ink-100);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.chart-card .panel-body { padding: 16px 20px 20px; }

@media (max-width: 900px) {
    .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dash-hero { padding: 20px; }
    .dash-hero-title { font-size: 17px; }
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.app-wrapper, .app-body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  body .main-content {
    margin-left: 0 !important;
    padding: 16px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
}

/* ============================================================
   Professional Split Login Design (Blue Theme)
   ============================================================ */

.split-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--ink-50);
}

.split-login-card {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 520px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 70px -30px rgba(15,23,42,0.35);
    overflow: hidden;
}


/* ============================================================
   Professional Split Login Design (Blue Theme) — v2, smoother
   ============================================================ */

.split-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 20% 20%, #eff6ff 0%, var(--ink-50) 55%);
}

.split-login-card {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 520px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 40px 80px -35px rgba(15,23,42,0.4), 0 2px 8px rgba(15,23,42,0.06);
    overflow: hidden;
    position: relative;
}

.split-login-form-side {
    flex: 1;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.split-login-form-side .login-title { text-align: left; font-size: 25px; }
.split-login-form-side .login-subtitle { text-align: left; margin-bottom: 28px; }

.split-login-brand-mark {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 19px;
    margin-bottom: 18px;
    box-shadow: 0 10px 22px -8px rgba(37,99,235,0.55);
}

/* Smooth curved divider instead of a hard diagonal cut */
.split-login-visual-side {
    flex: 0.85;
    position: relative;
    background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    padding: 52px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.split-login-visual-side::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 45%),
        radial-gradient(circle at 15% 90%, rgba(255,255,255,.10), transparent 50%);
}
/* soft curved seam on the left edge, replaces the sharp clip-path angle */
.split-login-visual-side::after {
    content: "";
    position: absolute; top: 0; bottom: 0; left: -1px;
    width: 60px;
    background: #fff;
    border-radius: 0 60% 60% 0 / 0 50% 50% 0;
    transform: translateX(-42px);
}

.split-login-orb {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    animation: float-orb 7s ease-in-out infinite;
}
.split-login-orb.o1 { width: 140px; height: 140px; top: -30px; right: -30px; }
.split-login-orb.o2 { width: 90px; height: 90px; bottom: 30px; left: 10%; animation-delay: -3s; }
.split-login-orb.o3 { width: 46px; height: 46px; top: 45%; right: 18%; animation-delay: -1.5s; }

@keyframes float-orb {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-14px); }
}

.split-login-visual-title {
    font-size: 29px; font-weight: 800; line-height: 1.25;
    position: relative; z-index: 2; margin-bottom: 14px;
}
.split-login-visual-text {
    font-size: 13.5px; color: rgba(255,255,255,0.88); line-height: 1.7;
    position: relative; z-index: 2; max-width: 260px;
}
.split-login-visual-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 9px 16px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    margin-top: 28px; width: fit-content;
    position: relative; z-index: 2;
    backdrop-filter: blur(4px);
}
.split-login-visual-badge svg { width: 13px; height: 13px; flex-shrink: 0; }

.split-login-footer-link {
    text-align: left; margin-top: 22px; font-size: 12.5px; color: var(--ink-500);
}
.split-login-footer-link a { color: var(--primary); font-weight: 600; text-decoration: none; }
.split-login-footer-link a:hover { text-decoration: underline; }

/* Segmented pill selector */
.segmented-control {
    display: flex;
    background: var(--ink-100);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 26px;
}
.segmented-control a {
    flex: 1;
    text-align: center;
    padding: 9px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-500);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.segmented-control a:hover { color: var(--ink-900); }
.segmented-control a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(37,99,235,0.55);
}

@media (max-width: 820px) {
    .split-login-card {
        flex-direction: column;
        min-height: auto;
        border-radius: 20px;
        max-width: 440px;
    }
    /* On mobile: no second box — the visual side becomes a slim top banner
       that blends into the same card instead of looking like a separate block. */
    .split-login-visual-side {
        padding: 26px 24px 30px;
        text-align: center;
        align-items: center;
    }
    .split-login-visual-side::after { display: none; }
    .split-login-visual-title { font-size: 21px; }
    .split-login-visual-text { max-width: 100%; font-size: 12.5px; }
    .split-login-visual-badge { margin-left: auto; margin-right: auto; }
    .split-login-orb.o1 { width: 90px; height: 90px; }
    .split-login-orb.o2, .split-login-orb.o3 { display: none; }
    .split-login-form-side { padding: 30px 24px 34px; }
    .split-login-form-side .login-title, .split-login-form-side .login-subtitle { text-align: center; }
}


.topbar-bell-btn {
    position: relative;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #eef2f9);
    box-shadow: 4px 4px 8px rgba(15,23,42,0.08), -3px -3px 7px rgba(255,255,255,0.9), inset 0 0 0 1px rgba(15,23,42,0.03);
    color: var(--ink-600);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-right: 10px;
}
.topbar-bell-btn:hover {
    transform: translateY(-1px);
    box-shadow: 5px 5px 10px rgba(15,23,42,0.10), -3px -3px 7px rgba(255,255,255,0.95);
    color: var(--primary);
}
.topbar-bell-badge {
    position: absolute; top: -4px; right: -4px;
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: #fff; font-size: 10px; font-weight: 700;
    min-width: 17px; height: 17px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(220,38,38,0.5);
    padding: 0 3px;
}


/* ============================================================
   UX Enhancements — Toasts, Modal, Spinner, Empty States, Skeleton
   ============================================================ */

.ux-toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.ux-toast { display: flex; align-items: flex-start; gap: 10px; background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 12px 28px -8px rgba(15,23,42,0.25); border-left: 4px solid; opacity: 0; transform: translateX(30px); transition: opacity 0.25s ease, transform 0.25s ease; }
.ux-toast-show { opacity: 1; transform: translateX(0); }
.ux-toast-success { border-color: #059669; }
.ux-toast-error { border-color: #dc2626; }
.ux-toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.ux-toast-success .ux-toast-icon { color: #059669; }
.ux-toast-error .ux-toast-icon { color: #dc2626; }
.ux-toast-icon svg { width: 100%; height: 100%; }
.ux-toast-msg { font-size: 13px; color: var(--ink-700, #334155); flex: 1; line-height: 1.5; }
.ux-toast-close { background: none; border: none; font-size: 16px; line-height: 1; color: var(--ink-400, #94a3b8); cursor: pointer; padding: 0; }

.ux-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; transition: opacity 0.2s ease; }
.ux-modal-show { opacity: 1; }
.ux-modal-box { background: #fff; border-radius: 16px; padding: 28px 26px; max-width: 380px; width: 90%; text-align: center; box-shadow: 0 30px 60px -20px rgba(15,23,42,0.4); transform: scale(0.92); transition: transform 0.2s ease; }
.ux-modal-show .ux-modal-box { transform: scale(1); }
.ux-modal-icon { width: 46px; height: 46px; margin: 0 auto 14px; color: #d97706; background: #fffbeb; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ux-modal-icon svg { width: 24px; height: 24px; }
.ux-modal-text { font-size: 14px; color: var(--ink-700, #334155); line-height: 1.6; margin-bottom: 22px; }
.ux-modal-actions { display: flex; gap: 10px; justify-content: center; }
.ux-modal-btn { padding: 9px 22px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.ux-modal-cancel { background: var(--ink-100, #f1f5f9); color: var(--ink-600, #475569); }
.ux-modal-confirm { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; box-shadow: 0 8px 18px -6px rgba(37,99,235,0.5); }

.ux-spinner-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.55); backdrop-filter: blur(1px); display: flex; align-items: center; justify-content: center; z-index: 9998; }
.ux-spinner { width: 42px; height: 42px; border: 4px solid var(--ink-100, #e2e8f0); border-top-color: var(--primary, #2563eb); border-radius: 50%; animation: ux-spin 0.7s linear infinite; }
@keyframes ux-spin { to { transform: rotate(360deg); } }

.ux-empty-wrap { text-align: center; padding: 30px 20px; }
.ux-empty-icon { width: 52px; height: 52px; margin: 0 auto 10px; color: var(--ink-300, #cbd5e1); }
.ux-empty-icon svg { width: 100%; height: 100%; }

.ux-skeleton-block { height: 240px; border-radius: 10px; background: linear-gradient(90deg, #f1f5f9 25%, #e8edf3 37%, #f1f5f9 63%); background-size: 400% 100%; animation: ux-shimmer 1.4s ease infinite; margin-bottom: 8px; }
@keyframes ux-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
/* ============================================================
   Empty State Fix — force-kills any leftover emoji icon and
   guarantees the enhancement icon is always small, everywhere
   ============================================================ */
.empty-msg::before { content: none !important; }

.ux-empty-wrap { text-align: center !important; padding: 30px 20px !important; }
.ux-empty-icon {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    margin: 0 auto 10px !important;
    color: var(--ink-300, #cbd5e1) !important;
    display: block !important;
}
.ux-empty-icon svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}
.empty-msg {
    font-size: 13px !important;
    color: var(--ink-500, #64748b) !important;
}