/* ==========================================
   CUSTOMERS PAGE
   ========================================== */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}


/* ==========================================
   Layout
   ========================================== */

.dashboard {
    width: 100%;
    min-height: 100vh;
}


/* Sidebar */

.sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 250px !important;
    min-width: 250px !important;
    height: 100vh !important;
    z-index: 1000 !important;
}


/* Main */

.main-content {
    position: relative !important;

    width: calc(100% - 250px) !important;
    margin-right: 250px !important;
    margin-left: 0 !important;

    min-width: 0 !important;

    padding: 30px !important;

    box-sizing: border-box !important;

    overflow-x: hidden !important;
}


/* ==========================================
   Header
   ========================================== */

.page-header {
    width: 100% !important;

    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;

    margin-bottom: 25px !important;

    box-sizing: border-box !important;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: #777;
}


/* ==========================================
   Add Button
   ========================================== */

.primary-btn {
    background: #55417d !important;
    color: white !important;

    border: none !important;

    padding: 12px 20px !important;

    border-radius: 8px !important;

    cursor: pointer !important;

    font-size: 15px !important;
}

.primary-btn:hover {
    opacity: 0.9;
}


/* ==========================================
   Statistics
   ========================================== */

.stats-grid {
    width: 100% !important;
    max-width: 100% !important;

    display: grid !important;

    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;

    gap: 20px !important;

    margin-bottom: 20px !important;

    box-sizing: border-box !important;
}

.stat-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    background: white;

    border-radius: 12px;

    padding: 22px;

    box-sizing: border-box;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card span {
    display: block;

    color: #777;

    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 24px;
}


/* ==========================================
   Content Cards
   ========================================== */

.content-card {
    width: 100% !important;
    max-width: 100% !important;

    background: white;

    border-radius: 12px;

    padding: 20px;

    margin-bottom: 20px;

    box-sizing: border-box;
}


/* ==========================================
   Search
   ========================================== */

.search-box {
    width: 100% !important;
}

.search-box input {
    width: 100% !important;
    max-width: 100% !important;

    padding: 13px 15px;

    box-sizing: border-box;

    border: 1px solid #ddd;

    border-radius: 8px;

    font-size: 15px;
}

.search-box input:focus {
    outline: none;

    border-color: #55417d;
}


/* ==========================================
   Table
   ========================================== */

.table-container {
    width: 100% !important;
    max-width: 100% !important;

    overflow-x: auto !important;
}

table {
    width: 100% !important;

    border-collapse: collapse;
}

thead {
    background: #f7f7f9;
}

th,
td {
    padding: 15px 12px;

    text-align: right;

    border-bottom: 1px solid #eee;
}

th {
    color: #666;

    font-weight: 600;
}


/* ==========================================
   Actions
   ========================================== */

.edit-btn,
.delete-btn {
    border: none;

    padding: 7px 12px;

    border-radius: 6px;

    cursor: pointer;

    margin-left: 5px;
}

.edit-btn {
    background: #eee;

    color: #333;
}

.delete-btn {
    background: #f8dddd;

    color: #b00000;
}


/* ==========================================
   Balance
   ========================================== */

.debt {
    color: #d00000;

    font-weight: bold;
}

.paid {
    color: #16803c;

    font-weight: bold;
}


/* ==========================================
   Empty State
   ========================================== */

.empty-state {
    text-align: center;

    padding: 40px;

    color: #777;
}


/* ==========================================
   Modal
   ========================================== */

.modal {
    display: none !important;

    position: fixed !important;

    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 100% !important;

    background: rgba(0, 0, 0, 0.45);

    align-items: center;

    justify-content: center;

    z-index: 99999 !important;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    width: 90%;

    max-width: 550px;

    background: white;

    border-radius: 12px;

    padding: 25px;

    box-sizing: border-box;
}

.modal-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 25px;
}

.modal-header h2 {
    margin: 0;
}

.close-btn {
    border: none;

    background: none;

    font-size: 28px;

    cursor: pointer;

    color: #777;
}


/* ==========================================
   Form
   ========================================== */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;

    box-sizing: border-box;

    padding: 11px;

    border: 1px solid #ddd;

    border-radius: 7px;

    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;

    gap: 10px;

    margin-top: 25px;
}

.secondary-btn {
    background: #eee;

    color: #333;

    border: none;

    padding: 11px 20px;

    border-radius: 7px;

    cursor: pointer;
}


/* ==========================================
   Mobile
   ========================================== */

@media (max-width: 800px) {

    .sidebar {
        position: relative !important;

        width: 100% !important;

        min-width: 0 !important;

        height: auto !important;
    }

    .main-content {
        width: 100% !important;

        margin: 0 !important;

        padding: 20px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .page-header {
        flex-direction: column !important;

        align-items: flex-start !important;

        gap: 15px;
    }

}