/* ========================================
   DASHBOARD CUSTOM STYLES
   ======================================== */

.dashboard-body {
    background-color: #f4f6fa;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    color: #333;
}

/* LOGIN SCREEN */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #0f4c81 0%, #082d4f 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 5px;
    color: #0f4c81;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.error-text {
    color: #d9534f;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

/* DASHBOARD LAYOUT */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.dashboard-sidebar {
    width: 260px;
    background-color: #082d4f;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    user-select: none;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-header .badge {
    display: inline-block;
    background-color: #d4af37;
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 10px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 15px;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border-right: 4px solid #d4af37;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* MAIN CONTENT */
.dashboard-main {
    flex: 1;
    margin-right: 260px;
    /* Sidebar width */
    padding: 30px 40px;
    background-color: #f4f6fa;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: #082d4f;
    margin: 0;
}

/* KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 20px;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon.blue {
    background-color: rgba(15, 76, 129, 0.1);
    color: #0f4c81;
}

.kpi-icon.green {
    background-color: rgba(92, 184, 92, 0.1);
    color: #5cb85c;
}

.kpi-icon.gold {
    background-color: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

.kpi-icon.red {
    background-color: rgba(217, 83, 79, 0.1);
    color: #d9534f;
}

.kpi-content h3 {
    font-size: 0.9rem;
    color: #777;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

/* ORDERS TABLE */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.table-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.table-filters select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    outline: none;
}

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

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

.orders-table th,
.orders-table td {
    padding: 15px 25px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.orders-table th {
    background-color: #fafbfc;
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

.orders-table tbody tr:hover {
    background-color: #fcfcfc;
}

.order-items-summary {
    font-size: 0.85rem;
    color: #555;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-new {
    background-color: #e3f2fd;
    color: #1e88e5;
}

.status-processing {
    background-color: #fff3e0;
    color: #fb8c00;
}

.status-completed {
    background-color: #e8f5e9;
    color: #43a047;
}

.status-cancelled {
    background-color: #ffebee;
    color: #e53935;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    background-color: transparent;
    border: 1px solid #0f4c81;
    color: #0f4c81;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background-color: #0f4c81;
    color: white;
}

.loading-state {
    text-align: center;
    padding: 40px !important;
    color: #888;
}

/* MODAL */
.dashboard-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.dashboard-modal.active {
    display: flex;
}

.dashboard-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.modal-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.modal-card.full-width {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.modal-card h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.1rem;
    color: #082d4f;
}

.modal-card p {
    margin: 10px 0;
    font-size: 0.95rem;
}

.modal-card p strong {
    color: #555;
    display: inline-block;
    width: 130px;
}

.modal-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-items-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #ddd;
}

.modal-items-list li:last-child {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.status-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.text-gold {
    color: #d4af37;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .dashboard-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .dashboard-main {
        margin-right: 0;
    }
}