/* ============================================
   TaxPro - Components CSS
   ============================================ */

/* ===== DASHBOARD BASE STYLES ===== */
.dashboard-body {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    background: #f0f3f8;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f1e28 0%, #1c3748 100%);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed { width: 70px; }

.sidebar-logo {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    height: 36px;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.sidebar-logo span {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-logo span { opacity: 0; }

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 16px 12px 8px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s;
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 3px;
    white-space: nowrap;
    position: relative;
    text-decoration: none;
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.25s;
}

.sidebar-link span {
    overflow: hidden;
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-link span { opacity: 0; }

.sidebar-link .badge {
    margin-left: auto;
    background: #d29427;
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 99px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar.collapsed .badge { display: none; }

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(210,148,39,0.2), rgba(210,148,39,0.05));
    color: #fff;
    border-left: 3px solid #d29427;
}

.sidebar-link.active i { color: #d29427; }

.sidebar-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1c3748;
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-link:hover .sidebar-tooltip { opacity: 1; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== TOPBAR ===== */
.topbar {
    height: 68px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(28,55,72,0.08);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: #1c3748;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.topbar-toggle:hover { background: rgba(28,55,72,0.06); }

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.topbar-breadcrumb .crumb { color: #9aa3af; }
.topbar-breadcrumb .crumb-sep { color: #d1d5db; }
.topbar-breadcrumb .crumb-active { color: #1c3748; font-weight: 600; }

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f3f8;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 8px 14px;
    transition: all 0.25s;
}

.topbar-search:focus-within {
    background: #fff;
    border-color: #d29427;
    box-shadow: 0 0 0 3px rgba(210,148,39,0.1);
}

.topbar-search i { color: #9aa3af; font-size: 0.875rem; }
.topbar-search input {
    background: none;
    border: none;
    font-size: 0.875rem;
    color: #1c3748;
    width: 180px;
    outline: none;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    background: #f0f3f8;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: #1c3748;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.topbar-icon-btn:hover { background: rgba(28,55,72,0.1); }

.topbar-icon-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #d29427;
    border-radius: 50%;
    border: 2px solid #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.2s;
}

.topbar-user:hover { background: #f0f3f8; }

.topbar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1c3748, #2a5270);
    color: #d29427;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.topbar-user-info { line-height: 1.3; }
.topbar-user-info strong { display: block; font-size: 0.85rem; color: #1c3748; }
.topbar-user-info small { color: #9aa3af; font-size: 0.72rem; }

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.4s ease;
}

.main-content.expanded { margin-left: 70px; }

.page-content {
    padding: 28px;
    flex: 1;
}

/* ===== DASHBOARD STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(28,55,72,0.07);
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(20px, -20px);
    transition: transform 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(28,55,72,0.1);
    border-color: rgba(210,148,39,0.15);
}

.stat-card:hover::before { transform: translate(10px, -10px); }

.stat-card.primary::before { background: #1c3748; }
.stat-card.accent::before { background: #d29427; }
.stat-card.success::before { background: #2ecc71; }
.stat-card.danger::before { background: #e74c3c; }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon.primary { background: rgba(28,55,72,0.1); color: #1c3748; }
.stat-icon.accent { background: rgba(210,148,39,0.12); color: #d29427; }
.stat-icon.success { background: rgba(46,204,113,0.1); color: #27ae60; }
.stat-icon.danger { background: rgba(231,76,60,0.1); color: #e74c3c; }
.stat-icon.info { background: rgba(52,152,219,0.1); color: #2980b9; }
.stat-icon.warning { background: rgba(243,156,18,0.1); color: #f39c12; }

.stat-info { flex: 1; }
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1c3748;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.8rem;
    color: #9aa3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-change {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: #27ae60; }
.stat-change.down { color: #e74c3c; }
.stat-change.neutral { color: #9aa3af; }

/* ===== DATA TABLE ===== */
.data-table-wrapper {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(28,55,72,0.07);
    overflow: hidden;
    border: 1px solid rgba(28,55,72,0.06);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(28,55,72,0.06);
    gap: 16px;
    flex-wrap: wrap;
}

.table-title {
    font-weight: 700;
    color: #1c3748;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-title i { color: #d29427; }

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1.5px solid rgba(28,55,72,0.1);
    border-radius: 10px;
    padding: 8px 14px;
    transition: all 0.25s;
}

.search-input-wrap:focus-within {
    border-color: #d29427;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(210,148,39,0.1);
}

.search-input-wrap i { color: #9aa3af; font-size: 0.85rem; }
.search-input-wrap input {
    border: none;
    background: none;
    font-size: 0.875rem;
    color: #1c3748;
    width: 160px;
    outline: none;
}

.btn-sm {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-sm-primary {
    background: #1c3748;
    color: #fff;
}

.btn-sm-primary:hover {
    background: #2a5270;
    transform: translateY(-1px);
}

.btn-sm-accent {
    background: linear-gradient(135deg, #d29427, #e8ae47);
    color: #fff;
    box-shadow: 0 2px 10px rgba(210,148,39,0.3);
}

.btn-sm-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(210,148,39,0.4);
}

.btn-sm-outline {
    background: transparent;
    border: 1.5px solid rgba(28,55,72,0.15);
    color: #1c3748;
}

.btn-sm-outline:hover {
    background: rgba(28,55,72,0.05);
}

.btn-sm-danger {
    background: rgba(231,76,60,0.1);
    color: #e74c3c;
    border: 1px solid rgba(231,76,60,0.2);
}

.btn-sm-danger:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-sm-success {
    background: rgba(46,204,113,0.1);
    color: #27ae60;
    border: 1px solid rgba(46,204,113,0.2);
}

.btn-sm-success:hover {
    background: #27ae60;
    color: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    background: #f8f9fa;
    border-bottom: 1px solid rgba(28,55,72,0.07);
}

.data-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9aa3af;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th:hover { color: #1c3748; }
.data-table th i { margin-left: 4px; font-size: 0.7rem; }

.data-table tbody tr {
    border-bottom: 1px solid rgba(28,55,72,0.05);
    transition: background 0.2s;
}

.data-table tbody tr:hover { background: rgba(28,55,72,0.02); }
.data-table tbody tr:last-child { border: none; }

.data-table td {
    padding: 14px 20px;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

/* ===== STATUS BADGES ===== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.badge-status.paid { background: rgba(46,204,113,0.12); color: #27ae60; border: 1px solid rgba(46,204,113,0.25); }
.badge-status.unpaid { background: rgba(231,76,60,0.1); color: #e74c3c; border: 1px solid rgba(231,76,60,0.2); }
.badge-status.pending { background: rgba(243,156,18,0.1); color: #d68910; border: 1px solid rgba(243,156,18,0.2); }
.badge-status.processing { background: rgba(52,152,219,0.1); color: #2980b9; border: 1px solid rgba(52,152,219,0.2); }
.badge-status.completed { background: rgba(28,55,72,0.08); color: #1c3748; border: 1px solid rgba(28,55,72,0.15); }
.badge-status.cancelled { background: rgba(127,140,141,0.1); color: #7f8c8d; border: 1px solid rgba(127,140,141,0.2); }
.badge-status.active { background: rgba(46,204,113,0.12); color: #27ae60; border: 1px solid rgba(46,204,113,0.25); }
.badge-status.inactive { background: rgba(231,76,60,0.1); color: #e74c3c; border: 1px solid rgba(231,76,60,0.2); }

.badge-status i { font-size: 0.65rem; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid rgba(28,55,72,0.06);
    font-size: 0.825rem;
    color: #9aa3af;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid rgba(28,55,72,0.1);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
    color: #1c3748;
}

.page-btn:hover { background: rgba(28,55,72,0.06); }
.page-btn.active {
    background: #1c3748;
    color: #fff;
    border-color: #1c3748;
}

.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== FORM CARDS ===== */
.form-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 1px 4px rgba(28,55,72,0.07);
    border: 1px solid rgba(28,55,72,0.06);
    margin-bottom: 24px;
}

.form-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1c3748;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(28,55,72,0.06);
}

.form-card-title i { color: #d29427; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #1c3748;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid rgba(28,55,72,0.12);
    border-radius: 10px;
    font-size: 0.875rem;
    color: #1c3748;
    background: #fff;
    transition: all 0.25s;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #d29427;
    box-shadow: 0 0 0 3px rgba(210,148,39,0.1);
    outline: none;
}

.form-textarea { resize: vertical; min-height: 100px; }

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-group { margin-bottom: 18px; }

/* ===== MODALS ===== */
.d-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,30,40,0.7);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.d-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.35s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}

.d-modal.sm { max-width: 440px; }
.d-modal.md { max-width: 600px; }
.d-modal.lg { max-width: 820px; }
.d-modal.xl { max-width: 1000px; }

.d-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(28,55,72,0.07);
    display: flex;
    align-items: center;
    gap: 14px;
}

.d-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.d-modal-icon.accent { background: rgba(210,148,39,0.12); color: #d29427; }
.d-modal-icon.primary { background: rgba(28,55,72,0.1); color: #1c3748; }
.d-modal-icon.danger { background: rgba(231,76,60,0.1); color: #e74c3c; }
.d-modal-icon.success { background: rgba(46,204,113,0.1); color: #27ae60; }

.d-modal-title { font-size: 1.05rem; font-weight: 700; color: #1c3748; }
.d-modal-subtitle { font-size: 0.825rem; color: #9aa3af; margin-top: 2px; }

.d-modal-close {
    margin-left: auto;
    width: 34px;
    height: 34px;
    background: rgba(28,55,72,0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa3af;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.d-modal-close:hover { background: #e74c3c; color: #fff; }

.d-modal-body { padding: 24px 28px; }

.d-modal-footer {
    padding: 16px 28px;
    border-top: 1px solid rgba(28,55,72,0.06);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== CHARTS CONTAINER ===== */
.chart-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(28,55,72,0.07);
    border: 1px solid rgba(28,55,72,0.05);
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1c3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-title span { color: #9aa3af; font-size: 0.8rem; font-weight: 400; }

/* ===== TOAST (Dashboard) ===== */
.d-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.d-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 8px 30px rgba(28,55,72,0.15);
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    animation: slideInRight 0.4s ease;
    border-left: 4px solid #d29427;
}

.d-toast.success { border-color: #27ae60; }
.d-toast.error { border-color: #e74c3c; }
.d-toast.info { border-color: #3498db; }
.d-toast.warning { border-color: #f39c12; }

.d-toast i { font-size: 1.1rem; }
.d-toast.success i { color: #27ae60; }
.d-toast.error i { color: #e74c3c; }
.d-toast.info i { color: #3498db; }
.d-toast.warning i { color: #f39c12; }

.d-toast-text { flex: 1; font-size: 0.875rem; color: #1c3748; font-weight: 500; }
.d-toast-close { cursor: pointer; color: #9aa3af; font-size: 0.8rem; transition: color 0.2s; }
.d-toast-close:hover { color: #1c3748; }

/* ===== ACTIVITY LOG ===== */
.activity-list { display: flex; flex-direction: column; gap: 0; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(28,55,72,0.05);
    position: relative;
}

.activity-item:last-child { border: none; }

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-dot.accent { background: #d29427; }
.activity-dot.success { background: #27ae60; }
.activity-dot.info { background: #3498db; }
.activity-dot.danger { background: #e74c3c; }

.activity-content { flex: 1; }
.activity-text { font-size: 0.85rem; color: #374151; line-height: 1.5; }
.activity-text strong { color: #1c3748; }
.activity-time { font-size: 0.75rem; color: #9aa3af; margin-top: 2px; }

/* ===== RESPONSIVE DASHBOARD ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .topbar-search { display: none; }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}