/* ===============================================
   دیکۆراتی گۆران — Modern App CSS
   =============================================== */

@font-face {
    font-family: "Hama";
    src: url("https://shtakanm.vercel.app/hama.ttf");
}

:root {
    /* Brand */
    --primary:        #111827;
    --primary-dark:   #030712;
    --primary-light:  #f3f4f6;
    --accent:         #374151;
    --accent2:        #6b7280;

    /* UI */
    --white:          #ffffff;
    --bg:             #f9fafb;
    --border:         #e5e7eb;
    --border-strong:  #d1d5db;

    /* Sidebar */
    --sidebar-bg:     #111827;
    --sidebar-text:   #9ca3af;
    --sidebar-hover:  #1f2937;
    --sidebar-active: #374151;

    /* Text */
    --text-main:      #111827;
    --text-muted:     #6b7280;
    --text-faint:     #9ca3af;

    /* Cards */
    --card-bg:        #ffffff;
    --card-border:    #f3f4f6;

    /* Semantic */
    --red:            #ef4444;
    --green:          #10b981;
    --yellow:         #f59e0b;
    --blue:           #3b82f6;
    --purple:         #8b5cf6;
    --orange:         #f97316;

    /* Shadows */
    --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
    --shadow:      0 1px 6px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.14);
    --shadow-xl:   0 20px 60px rgba(0,0,0,0.18);

    /* Geometry */
    --radius-xs:   6px;
    --radius-sm:   10px;
    --radius:      14px;
    --radius-lg:   20px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-w:   260px;
    --topbar-h:    60px;

    /* Motion */
    --ease:        cubic-bezier(0.4, 0, 0.2, 1);
    --dur:         0.2s;
    --transition:  all var(--dur) var(--ease);
}

/* ===== RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text-main);
    direction: rtl;
    font-size: 16px;
    font-family: Hama, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: Hama, sans-serif; }
input, select, textarea { font-family: Hama, sans-serif; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dark);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(55,65,81,0.4) 0%, transparent 70%),
        radial-gradient(ellipse 400px 600px at 80% 20%, rgba(17,24,39,0.6) 0%, transparent 70%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.login-logo { text-align: center; margin-bottom: 36px; }

.login-logo .icon {
    width: 68px;
    height: 68px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.3px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-main);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.form-control::placeholder { color: var(--text-faint); }

.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-right: 42px; }
.input-icon-wrap .input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 15px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(17,24,39,0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(17,24,39,0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--border-strong);
}

.btn-danger { background: #fef2f2; color: var(--red); }
.btn-danger:hover { background: #fee2e2; }

.btn-success { background: #ecfdf5; color: var(--green); }
.btn-success:hover { background: #d1fae5; }

.btn-sm { padding: 6px 13px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-width: 1px;
    border-style: solid;
}

.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s var(--ease);
    overflow: hidden;
}

/* Subtle inner glow on sidebar right edge */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,0.06);
}

.sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.logo-wrap i {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.12);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 17px;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 10px;
    overflow-y: auto;
}

/* Sidebar section label */
.sidebar-nav::before {
    content: 'منوو';
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 10px 4px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    transition: var(--transition);
    margin-bottom: 2px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #e5e7eb;
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Active left-bar indicator — RTL so left = trailing edge */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: white;
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active i { opacity: 1; }

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    font-size: 13px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
}

.user-info i { font-size: 20px; color: #9ca3af; }

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(239,68,68,0.08);
    color: #f87171;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(239,68,68,0.12);
}

.logout-btn:hover {
    background: rgba(239,68,68,0.16);
    border-color: rgba(239,68,68,0.25);
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-right: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin 0.28s var(--ease);
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 14px;
    box-shadow: var(--shadow-xs);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-main);
    padding: 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.menu-toggle:hover { background: var(--bg); }

.topbar-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    flex: 1;
    letter-spacing: -0.2px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-badge {
    background: var(--primary-light);
    color: var(--text-main);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid var(--border);
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1;
    padding: 22px 24px;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.page-header h2 i {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ===== DASHBOARD STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    transition: var(--transition);
    cursor: default;
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; color: var(--blue); }
.stat-icon.green  { background: #ecfdf5; color: var(--green); }
.stat-icon.red    { background: #fef2f2; color: var(--red); }
.stat-icon.yellow { background: #fffbeb; color: var(--yellow); }
.stat-icon.purple { background: #f5f3ff; color: var(--purple); }
.stat-icon.orange { background: #fff7ed; color: var(--orange); }

.stat-info { flex: 1; min-width: 0; }

.stat-num {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ===== CARD ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--white);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.1px;
}

.card-header h3 i {
    color: var(--text-muted);
    font-size: 13px;
}

.card-body { padding: 20px; }

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrap i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 13px;
}

.search-input {
    width: 100%;
    padding: 9px 36px 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: var(--transition);
    background: var(--white);
    outline: none;
    color: var(--text-main);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17,24,39,0.07);
}

.filter-select {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--white);
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    min-width: 130px;
}

.filter-select:focus { border-color: var(--primary); }

/* ===== TABLE ===== */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.table thead th {
    background: var(--bg);
    padding: 13px 18px;
    text-align: right;
    color: var(--text-faint);
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-main);
    font-size: 15px;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
    transition: background var(--dur) var(--ease);
}

.table tbody tr:hover { background: #fafafa; }

/* ===== PROFILE CELL ===== */
.profile-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-cell img,
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    border: 1.5px solid var(--border);
}

.avatar { border-radius: 10px; }

.profile-name { font-weight: 700; font-size: 15px; color: var(--text-main); }
.profile-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }

/* ===== ACTION BUTTONS ===== */
.actions {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    flex-shrink: 0;
}

.btn-icon.edit      { background: #eff6ff; color: var(--blue); }
.btn-icon.edit:hover { background: var(--blue); color: white; }
.btn-icon.delete     { background: #fef2f2; color: var(--red); }
.btn-icon.delete:hover { background: var(--red); color: white; }
.btn-icon.view      { background: #ecfdf5; color: var(--green); }
.btn-icon.view:hover { background: var(--green); color: white; }
.btn-icon.add-task  { background: #f5f3ff; color: var(--purple); }
.btn-icon.add-task:hover { background: var(--purple); color: white; }

/* ===== MODAL ===== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal-backdrop.show { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.22s var(--ease);
    border: 1px solid var(--border);
}

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

.modal-lg { max-width: 700px; }
.modal-sm { max-width: 420px; }

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}

.modal-close {
    background: var(--bg);
    border: 1px solid var(--border);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 13px;
}

.modal-close:hover { background: #fef2f2; color: var(--red); border-color: #fecaca; }

.modal-body    { padding: 22px; }

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== FORM GRID ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid .col-full { grid-column: 1 / -1; }

/* ===== PHOTO UPLOAD ===== */
.photo-upload {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--bg);
}

.photo-upload:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.photo-upload i { font-size: 26px; color: var(--text-faint); }
.photo-upload p { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.photo-preview {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid var(--border);
}

/* ===== PROFILE HERO ===== */
.profile-hero {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 28px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.profile-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: 60px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

.profile-hero img,
.profile-hero-avatar {
    width: 88px;
    height: 88px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.profile-hero-info { position: relative; z-index: 1; }

.profile-hero-info h2 {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.profile-hero-info p {
    font-size: 13px;
    opacity: 0.75;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.profile-tab {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.1px;
}

.profile-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== DEBT STATUS ===== */
.debt-unpaid { color: var(--red); font-weight: 700; }
.debt-paid   { color: var(--green); font-weight: 700; }

/* ===== RECEIPT BUTTON ===== */
.receipt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border);
    transition: var(--transition);
}

.receipt-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text-main);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; color: var(--border-strong); margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; }
.empty-state p  { font-size: 13px; color: var(--text-faint); }

/* ===== LOADING ===== */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 36px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--primary);
    color: white;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.28s var(--ease);
    max-width: 300px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
}

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

.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
.toast.warning { background: #92400e; }

/* ===== MATERIAL CARDS ===== */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.material-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.material-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 36px;
}

.material-body    { padding: 13px; }
.material-name    { font-size: 13px; font-weight: 800; color: var(--text-main); margin-bottom: 5px; }
.material-price   { font-size: 15px; font-weight: 900; color: var(--primary); margin-bottom: 6px; }
.material-notes   { font-size: 11px; color: var(--text-muted); }
.material-actions { padding: 10px 13px; border-top: 1px solid var(--border); display: flex; gap: 7px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .sidebar {
        width: 270px;
        transform: translateX(270px);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-close { display: flex; }
    .main-wrapper  { margin-right: 0; }
    .menu-toggle   { display: flex; }
    .overlay.show  { display: block; }

    .content-area { padding: 14px 16px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card  { padding: 14px; gap: 10px; }
    .stat-num   { font-size: 20px; }
    .stat-icon  { width: 40px; height: 40px; font-size: 17px; }

    .form-grid  { grid-template-columns: 1fr; }

    .page-header h2 { font-size: 17px; }
    .page-header h2 i { width: 32px; height: 32px; font-size: 14px; }

    .filter-bar { flex-direction: column; }
    .search-input-wrap { min-width: 100%; }

    .table thead th, .table tbody td { padding: 10px 12px; }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin-top: auto;
        max-height: 96vh;
    }
    .modal-backdrop { align-items: flex-end; padding: 0; }

    .profile-hero { padding: 18px; gap: 14px; }
    .profile-hero img,
    .profile-hero-avatar { width: 68px; height: 68px; font-size: 24px; }
    .profile-hero-info h2 { font-size: 17px; }

    .materials-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .login-card { padding: 30px 22px; }

    .toast-container { left: 12px; right: 12px; bottom: 14px; }
    .toast { max-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid        { grid-template-columns: 1fr 1fr; gap: 8px; }
    .materials-grid    { grid-template-columns: 1fr; }
    .profile-tabs      { gap: 5px; }
    .profile-tab       { padding: 7px 12px; font-size: 11px; }
    .content-area      { padding: 12px; }
}

/* ===== PRINT / RECEIPT ===== */
.receipt-modal {
    background: white;
    padding: 28px;
    border-radius: var(--radius);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed var(--border);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.receipt-header h2 { font-size: 18px; color: var(--text-main); font-weight: 800; }
.receipt-header p  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.receipt-row:last-child { border: none; }
.receipt-label { color: var(--text-muted); }
.receipt-value { font-weight: 700; }

@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .main-wrapper { margin: 0; }
    .topbar, .sidebar { display: none; }
}
