/* ========================================
   TINDA Dashboard Styles
   ======================================== */

:root {
    --bg-main: #050505;
    --bg-secondary: #0d0d0d;
    --bg-card: #1a1a1a;
    --accent-red: #D32F2F;
    --accent-red-bright: #E53935;
    --accent-red-dark: #B71C1C;
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
    --text-gray-dark: #888888;
    --border-color: #2a2a2a;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.6);
    --success-green: #4CAF50;
    --warning-orange: #FF9800;
}

/* ========================================
   Global Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 20px 0;
    z-index: 1000;
    overflow-y: auto;
}

.logo-section {
    text-align: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-logo {
    height: 50px;
    width: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 8px rgba(211, 47, 47, 0.3));
    transition: filter 0.3s ease;
}

.sidebar-logo:hover {
    filter: drop-shadow(0 4px 12px rgba(211, 47, 47, 0.5));
}

.logo-section h2 {
    color: var(--accent-red);
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 5px;
}

.logo-section p {
    color: var(--text-gray);
    font-size: 12px;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    padding: 14px 20px;
    margin: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover {
    background: linear-gradient(90deg, transparent, rgba(211, 47, 47, 0.1));
}

.nav-item.active {
    background: linear-gradient(90deg, var(--accent-red), var(--accent-red-dark));
    color: var(--text-white);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    margin-right: 240px;
    padding: 20px;
    min-height: 100vh;
}

/* ========================================
   Top Header
   ======================================== */

.top-header {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 18px var(--shadow-heavy);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-white);
    margin-bottom: 5px;
}

.header-title p {
    color: var(--text-gray);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-white);
    outline: none;
    width: 100%;
    font-family: 'Cairo', sans-serif;
}

.search-box i {
    color: var(--text-gray);
}

.btn-refresh {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dark));
    color: var(--text-white);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.5);
}

/* ========================================
   Stats Grid
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(180deg, #171717, #121212);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 18px var(--shadow-heavy);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px var(--shadow-heavy), 0 0 20px rgba(211, 47, 47, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), transparent);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(211, 47, 47, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-red);
}

.stat-title {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-white);
    margin-bottom: 5px;
}

.stat-change {
    font-size: 13px;
    color: var(--success-green);
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.negative {
    color: var(--warning-orange);
}

/* ========================================
   Data Table Section
   ======================================== */

.table-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px var(--shadow-heavy);
    margin-bottom: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-white);
}

.table-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--accent-red);
    background: rgba(211, 47, 47, 0.1);
}

/* ========================================
   Table Styles
   ======================================== */

.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--accent-red);
}

.data-table th {
    padding: 15px;
    text-align: right;
    font-weight: 800;
    font-size: 14px;
    color: var(--text-white);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(211, 47, 47, 0.05);
}

.data-table td {
    padding: 15px;
    color: var(--text-gray);
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success-green);
}

.status-pending {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning-orange);
}

.status-inactive {
    background: rgba(136, 136, 136, 0.2);
    color: var(--text-gray-dark);
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.action-btn:hover {
    border-color: var(--accent-red);
    background: var(--accent-red);
    color: var(--text-white);
}

/* ========================================
   Loading & Empty States
   ======================================== */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-white);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-right: 200px;
    }
    .search-box {
        width: 200px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* ========================================
   Analytics & Charts
   ======================================== */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px var(--shadow-heavy);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h3 i {
    color: var(--accent-red);
}

canvas {
    max-height: 300px;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.quick-stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.1), transparent);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.quick-stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-red);
    margin-bottom: 8px;
}

.quick-stat-label {
    font-size: 14px;
    color: var(--text-gray);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(211, 47, 47, 0.05);
    border-color: var(--accent-red);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: rgba(211, 47, 47, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red);
    font-size: 18px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    color: var(--text-white);
    font-weight: 700;
    margin-bottom: 4px;
}

.activity-time {
    color: var(--text-gray);
    font-size: 12px;
}

.activity-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
    }
    .top-header {
        flex-direction: column;
        gap: 15px;
    }
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    .search-box {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .quick-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================
   Action Buttons (Edit & Delete)
   ======================================== */

.btn-edit, .btn-delete {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 4px;
}

.btn-edit {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.5);
    transform: translateY(-2px);
}

.btn-edit:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(30, 136, 229, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.5);
    transform: translateY(-2px);
}

.btn-delete:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(229, 57, 53, 0.4);
}

/* ========================================
   Modal Buttons
   ======================================== */

.btn-save, .btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.btn-save {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

.btn-save:hover {
    background: linear-gradient(135deg, var(--accent-red-bright) 0%, var(--accent-red) 100%);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.6);
    transform: translateY(-2px);
}

.btn-cancel {
    background: var(--bg-card);
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--bg-secondary);
    color: var(--text-white);
    border-color: var(--text-gray-dark);
}
