/* Font Face */
@font-face {
    font-family: 'Speda';
    src: url('fonts/Speda.ttf');
}

/* Reset & General */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Speda', sans-serif;
    background-color: #f1f5f9;
    display: flex;
    direction: rtl;
}

/* Sidebar Menu Styles */
.sidebar {
    width: 280px;
    background-color: #0f172a;
    color: #ffffff;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #1e293b;
}

.sidebar-header h2 {
    color: #fbbf24;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.sidebar ul {
    list-style: none;
    margin-top: 20px;
}

.sidebar ul li {
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 1px solid #1e293b;
    font-size: 15px;
}

.sidebar ul li:hover {
    background-color: #fbbf24;
    color: #0f172a;
    padding-right: 35px;
}

/* Main Content Wrapper */
.main-content {
    margin-right: 280px;
    padding: 40px;
    width: calc(100% - 280px);
}

.section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Metrics Card Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.stat-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-top: 5px solid #fbbf24;
}

.stat-card h3 {
    color: #64748b;
    font-size: 18px;
    margin-bottom: 10px;
}

.stat-card .num {
    font-size: 32px;
    font-weight: bold;
    color: #0f172a;
}

.alert-container {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    margin-top: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Forms Structuring */
.form-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.form-container h3 {
    margin-bottom: 15px;
    border-bottom: 2px solid #fbbf24;
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.input-group label {
    margin-bottom: 8px;
    color: #475569;
    font-weight: bold;
}

input, select {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Speda';
    outline: none;
    background: #fff;
}

input:focus, select:focus {
    border-color: #fbbf24;
}

input[readonly] {
    background: #f1f5f9;
    cursor: not-allowed;
}

.full-width {
    grid-column: span 4;
}

/* Tables Formatting */
.table-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 10px;
}

table {
    width: 100%;
    background: #ffffff;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

th {
    background-color: #334155;
    color: #ffffff;
    padding: 15px;
    text-align: center;
}

td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background-color: #f8fafc;
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}
.status-active { background: #dcfce7; color: #15803d; }
.status-expired { background: #fee2e2; color: #b91c1c; }
.status-left { background: #f1f5f9; color: #475569; }

/* Global Buttons UI */
.btn-save {
    background-color: #0f172a;
    color: #fbbf24;
    padding: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Speda';
    transition: 0.3s;
}

.btn-save:hover {
    background-color: #1e293b;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 2px;
    font-family: 'Speda';
}

.btn-print { background: #fbbf24; color: #0f172a; font-weight: bold;}
.btn-delete { background: #ef4444; color: #fff; }

/* Popup Modals Structuring */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    width: 480px;
    max-height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
}

.num {
    font-family: Arial, sans-serif !important;
}

/* قفڵکردنی ناوچەی پسوولە تەنها بۆ شاشەی چاپ بۆ ئەوەی لە وێب جێنەمێنێت */
.print-header-logo, .print-header-logo-receipt, .print-only-container {
    display: none !important;
}

/* 🧱 ڕێکخستنی بزوێنەری چاپ */
@media print {
    body {
        background: #fff;
        color: #000;
    }
    
    /* وندنی سەرجەم کایەکانی شاشە بە فەرمی */
    .no-print, .sidebar, .modal, .btn-action, .btn-save, input, select, button { 
        display: none !important; 
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    /* شاردنەوەی خشتەکان ئەگەر دۆخی چاپیان لەسەر نەبێت */
    .section {
        display: none !important;
    }
    
    /* پیشاندانی تەنها ئەو خشتەیەی مەبەستە */
    .section.print-active {
        display: block !important;
    }
    
    /* فۆڕماتی سەرپەڕی خشتە چاپکراوەکان */
    .print-header-logo {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 2px solid #000;
        padding-bottom: 15px;
    }
    .print-header-logo img {
        width: 120px;
        height: auto;
        margin-bottom: 10px;
    }
    
    table {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        width: 100% !important;
    }
    th {
        background-color: #f1f5f9 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    td {
        border: 1px solid #000 !important;
    }
    
    /* پیشاندانی فۆڕم و پسوولەی تاکەکەسی تەنها کاتێک کۆدی تێدابێت */
    .print-only-container:not(:empty) { 
        display: block !important; 
        width: 100%;
    }
    
    .receipt-box {
        border: 2px solid #000;
        padding: 30px;
        text-align: center;
        width: 100%;
        margin-top: 20px;
        direction: rtl;
    }
    .print-header-logo-receipt {
        display: block !important;
        text-align: center;
    }
    .print-header-logo-receipt img {
        width: 110px;
    }
    .receipt-row {
        display: flex;
        justify-content: space-between;
        margin: 15px 0;
        border-bottom: 1px dashed #000;
        padding-bottom: 5px;
        font-size: 16px;
    }
}