/* ============================
   Global
============================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background-color: #f7f8fc;
    color: #2d2d3a;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================
   Navbar
============================ */
.navbar {
    width: 95%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 10px;
    border-bottom: 1px solid #eee;
}

.logo {
    font-weight: 900;
    color: #e91e63;
    font-size: 1.2rem;
}

.nav-left a, .nav-left button {
    text-decoration: none;
    color: #555;
    margin-right: 18px;
    font-size: 0.9rem;
    transition: color .2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.nav-left a:hover, .nav-left button:hover { color: #e91e63; }

/* ============================
   Dashboard Cards
============================ */
.dashboard {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
    width: 95%;
    max-width: 1100px;
}

.card {
    flex: 1;
    min-width: 150px;
    background: #fff;
    padding: 16px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    text-align: center;
    border-top: 3px solid #e91e63;
}
.card h3 { font-size: 0.78rem; color: #888; margin: 0 0 6px; font-weight: 500; }
.card p  { font-size: 1.1rem; font-weight: 700; color: #2d2d3a; margin: 0; }

/* ============================
   Chart box
============================ */
.show-box {
    width: 95%;
    max-width: 1100px;
    margin: 10px 0;
    padding: 20px 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    text-align: center;
    font-weight: 700;
    color: #e91e63;
}
#portfolioChart {
    width: 240px !important;
    height: 240px !important;
    margin: 10px auto 0;
    display: block;
}

/* ============================
   Container
============================ */
.container {
    width: 95%;
    max-width: 1100px;
    margin: 20px 0;
    padding: 20px 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* ============================
   Headings
============================ */
h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 10px;
    color: #e91e63;
    font-size: 1.05rem;
}

/* ============================
   Forms
============================ */
form {
    margin-bottom: 0;
    background: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
}

label {
    font-size: 0.82rem;
    color: #666;
    display: block;
    margin-bottom: 2px;
    margin-top: 8px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 8px 10px;
    margin: 3px 0 8px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
    color: #1a1a2e;
}
input:focus, select:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233,30,99,0.12);
    outline: none;
    background: #fff;
}

button {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
    padding: 9px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    transition: opacity .2s, transform .1s;
}
button:hover  { opacity: .9; }
button:active { transform: scale(.97); }

/* ============================
   Tables - portfolio only
============================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 0.85rem;
}
table th, table td {
    padding: 9px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
table th {
    background: #e91e63;
    color: #fff;
    font-weight: 600;
}
table tr:nth-child(even) { background: #fdf2f6; }
table tr:hover           { background: #ffe6f0; }

/* ============================
   Colours
============================ */
.pos  { color: #1aa558; font-weight: 700; }
.neg  { color: #e53935; font-weight: 700; }
.disc { color: #7c3aed; font-weight: 700; }
.div-highlight { color: #d97706; }

/* ============================
   Modal
============================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; right: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
}
.modal-content {
    background: #fff;
    width: 90%;
    max-width: 480px;
    margin: 60px auto;
    padding: 24px 22px;
    border-radius: 14px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    max-height: 85vh;
    overflow-y: auto;
}
.modal-wide {
    width: 740px;
    max-width: 96vw;
    max-height: 88vh;
    overflow-y: auto;
}
.close {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 22px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    transition: color .2s;
}
.close:hover { color: #e91e63; }

/* ============================
   Form helpers
============================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}
@media(max-width:600px){ .form-grid { grid-template-columns: 1fr; } }

.inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.inline-row select { flex: 1; margin: 3px 0 8px; }
.inline-row input  { margin: 3px 0 8px; }

.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}
.toggle-row input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #e91e63;
    margin: 0;
}
.toggle-row label { margin: 0; font-size: 0.88rem; cursor: pointer; }

/* ============================
   Tooltip
============================ */
.col-tooltip {
    position: fixed;
    background: #1a1a2e;
    color: #f0f0f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    max-width: 260px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    line-height: 1.4;
}

/* ============================
   Report wrapper
============================ */
.report-wrapper {
    width: 95%;
    max-width: 1200px;
    margin: 24px 0 40px;
}

.report-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-edit {
    background: #fff;
    color: #e91e63;
    border: 2px solid #e91e63;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}
.btn-edit:hover { background: #e91e63; color: #fff; }

.export-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.export-group span { font-size: 0.85rem; color: #888; }
.export-group button {
    background: #fff;
    color: #444;
    border: 1.5px solid #ddd;
    padding: 7px 16px;
    font-size: 0.83rem;
    border-radius: 7px;
    font-weight: 600;
    transition: .2s;
}
.export-group button:hover { border-color: #e91e63; color: #e91e63; background: #fff5f8; }

/* ============================
   Report Header Card
============================ */
.report-header-card {
    background: linear-gradient(135deg, #e91e63 0%, #880e4f 100%);
    color: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 6px 24px rgba(233,30,99,0.28);
}
.rhc-title {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: .75;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.rhc-stock {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.rhc-reinvest-badge {
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
}
.rhc-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rhc-stat {
    background: rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 140px;
    flex: 1;
}
.rhc-label { font-size: 0.7rem; opacity: .8; display: block; margin-bottom: 3px; }
.rhc-val   { font-size: 1rem; font-weight: 700; display: block; }
.rhc-val.pos  { color: #afffca; }
.rhc-val.disc { color: #d8b4fe; }
.rhc-sub   { font-size: 0.72rem; opacity: .85; display: block; margin-top: 4px; }

.rhc-goal { border: 1.5px solid rgba(255,255,255,0.3); }
.goal-met     { background: rgba(16,185,129,0.25) !important; }
.goal-pending { background: rgba(251,191,36,0.2)  !important; }

/* ============================
   Year blocks
============================ */
.year-block {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 20px;
    overflow: hidden;
}
.year-block-header {
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.year-label { font-size: 1rem; font-weight: 800; }
.year-meta  { font-size: 0.76rem; opacity: .85; }
.year-meta strong { color: #f9a8d4; }
.goal-pct { color: #fde68a; font-size: 0.72rem; }

/* ============================
   Monthly table
============================ */
.monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.79rem;
}

/* flat single-colour header — no alternating tones */
.monthly-table thead tr:first-child th {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 9px 10px;
    font-weight: 600;
    white-space: nowrap;
    border: none;
}

/* grouped column sub-headers */
.monthly-table thead tr.th-sub th {
    background: #16213e;
    color: #cbd5e1;
    padding: 5px 10px;
    font-size: 0.72rem;
    border-bottom: 1px solid #0f3460;
}

/* column group labels in first header row */
.th-group-main {
    background: #1a1a2e !important;
    border-left: 2px solid #e91e63 !important;
    border-right: 2px solid #e91e63 !important;
}
.th-group-reinvest {
    background: #1a1a2e !important;
    border-left: 2px solid #7c3aed !important;
    border-right: 2px solid #7c3aed !important;
}

.monthly-table td {
    padding: 7px 10px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    color: #374151;
}
.monthly-table tr:nth-child(even) td { background: #f9fafb; }
.monthly-table tr:hover td           { background: #fff5f8; }

/* dividend rows */
.monthly-table tr.div-row td        { background: #fff8e1 !important; }
.monthly-table tr.div-row:hover td  { background: #fff3cd !important; }

.div-cell { color: #d97706; font-weight: 700; }
.div-cell small { font-weight: 400; color: #92400e; display: block; font-size: 0.7rem; }

/* year totals footer row */
.monthly-table tfoot tr.year-totals td {
    background: #1a1a2e !important;
    color: #f1f5f9;
    font-size: 0.8rem;
    border-top: 2px solid #e91e63;
    padding: 9px 10px;
}

/* source badge */
.source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    background: #f3f4f6;
    color: #6b7280;
}
.source-badge.active {
    background: #fce7f3;
    color: #be185d;
    font-weight: 600;
}

/* goal row highlight in yearly table */
.goal-row td { background: #ecfdf5 !important; }
.goal-row:hover td { background: #d1fae5 !important; }

/* ============================
   Goal progress bar
============================ */
.goal-bar-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}
.goal-bar {
    height: 6px;
    background: linear-gradient(90deg, #e91e63, #f59e0b);
    border-radius: 3px;
    transition: width .3s;
    min-width: 2px;
}
.goal-bar-wrap span { font-size: 0.72rem; white-space: nowrap; }

/* ============================
   Responsive
============================ */
@media(max-width: 768px) {
    .container, .report-wrapper,
    .dashboard, .show-box, .navbar { width: 98%; }
    .modal-wide   { width: 97vw; }
    .rhc-stats    { gap: 8px; }
    .rhc-stat     { min-width: 120px; }
    .report-actions { flex-direction: column; align-items: flex-start; }
    .year-block-header { flex-direction: column; align-items: flex-start; }
}

/* ============================
   Monthly table — group headers
============================ */
.th-group {
    background: #e91e63 !important;
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.th-group-alt {
    background: #1565c0 !important;
}
.th-sub-cell {
    background: #2d2d3a !important;
    color: #cbd5e1 !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
}

/* Year total footer row */
.year-total-row td {
    background: #1a1a2e !important;
    color: #f1f5f9 !important;
    font-size: 0.8rem;
    border-top: 2px solid #e91e63;
}
.year-total-row td strong { color: #fde68a; }
.year-total-row td strong.pos { color: #86efac; }

/* Tooltip */
.tooltip-box {
    display: none;
    position: fixed;
    z-index: 9999;
    background: #1a1a2e;
    color: #f1f5f9;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    max-width: 260px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    pointer-events: none;
}
.th-tip {
    cursor: help;
    border-bottom: 1px dashed rgba(255,255,255,0.4);
    padding-bottom: 1px;
}

/* Summary card passive goal states */
.rhc-stat.goal-reached { background: rgba(134,239,172,0.15); border: 1px solid rgba(134,239,172,0.4); }
.rhc-stat.goal-pending { background: rgba(251,191,36,0.1);  border: 1px solid rgba(251,191,36,0.3); }
.rhc-sub { display: block; font-size: 0.75rem; margin-top: 4px; opacity: .85; }
.rhc-reinvest-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 8px;
    vertical-align: middle;
}

/* ============================
   imexc.php - Goal progress
============================ */
.imagine-form {
    background: #fff;
    padding: 24px 28px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.goal-progress-wrap {
    margin-top: 12px;
    width: 100%;
}
.goal-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    margin-bottom: 6px;
    opacity: 0.9;
}
.goal-progress-bars {
    display: flex;
    gap: 4px;
    height: 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    overflow: hidden;
}
.goal-bar-current {
    background: #f59e0b;
    transition: width 0.3s;
}
.goal-bar-projected {
    background: #10b981;
    transition: width 0.3s;
}

/* Monthly table styles */
.table-scroll { overflow-x: auto; }
.monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.monthly-table th {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 9px 10px;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.75rem;
}
.monthly-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    color: #374151;
}
.monthly-table tr:nth-child(even) td { background: #f9fafb; }
.monthly-table tr:hover td           { background: #fff5f8; }

.div-row td { background: #fff8e1 !important; }
.div-row:hover td { background: #fff3cd !important; }
.div-cell { color: #d97706; font-weight: 700; }
.div-cell small { font-weight: 400; color: #92400e; display: block; font-size: 0.7rem; }

.source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    background: #f3f4f6;
    color: #6b7280;
}
.source-badge.active {
    background: #fce7f3;
    color: #be185d;
    font-weight: 600;
}

.th-group {
    background: #e91e63 !important;
    color: #fff !important;
    font-weight: 700;
}
.th-group-alt {
    background: #1565c0 !important;
}
.th-sub-cell {
    background: #2d2d3a !important;
    color: #cbd5e1 !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
}

.year-total-row td {
    background: #1a1a2e !important;
    color: #f1f5f9 !important;
    font-size: 0.8rem;
}
.year-total-row td strong { color: #fde68a; }
.year-total-row td strong.pos { color: #86efac; }

.goal-row td { background: #ecfdf5 !important; }
.goal-row:hover td { background: #d1fae5 !important; }

/* ============================
   imexc.php - Step Form
============================ */
.form-wrapper {
    background: #fff;
    padding: 30px 35px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    transition: all 0.4s ease;
    max-height: 10000px;
    overflow: visible;
}

.form-wrapper.collapsed {
    max-height: 0;
    padding: 0 35px;
    margin-bottom: 0;
    overflow: hidden;
    opacity: 0;
}

.step-section {
    animation: fadeIn 0.3s;
}

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

.step-title {
    color: #e91e63;
    font-size: 1.15rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.form-row {
    margin-bottom: 16px;
}

.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
    background: #fff;
    color: #e91e63;
    border: 2px solid #e91e63;
    padding: 10px 26px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-secondary:hover { background: #fff5f8; }

.edit-btn-wrapper {
    text-align: center;
    margin: 20px 0 30px;
}

.btn-edit-main {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    padding: 14px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
    transition: 0.2s;
}
.btn-edit-main:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(76,175,80,0.4); }

/* Stock form blocks */
#stocksContainer {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stock-form-block {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    position: relative;
}

.stock-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.stock-form-header h4 {
    margin: 0;
    color: #1a1a2e;
    font-size: 1rem;
}

.btn-remove {
    background: #ef4444;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}
.btn-remove:hover { background: #dc2626; transform: scale(1.1); }

/* Goal progress bars */
.goal-stat {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.goal-bars {
    margin-top: 12px;
}

.goal-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: #78350f;
}

.goal-bar-track {
    height: 14px;
    background: rgba(120,53,15,0.15);
    border-radius: 8px;
    overflow: hidden;
}

.goal-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #10b981);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* Stock section */
.stock-section {
    margin-bottom: 40px;
}

.stock-section h3 {
    color: #1a1a2e;
    font-size: 1.2rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 3px solid #e91e63;
}

/* Reinvest column */
.reinvest-cell {
    background: #f0fdf4 !important;
}
.reinvest-badge {
    display: inline-block;
    background: #10b981;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.reinvest-source {
    color: #059669;
    font-size: 0.7rem;
}

/* Goal reminder in step 2 */
.goal-reminder {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1rem;
}
.goal-reminder strong {
    color: #92400e;
    font-size: 1.3rem;
    margin: 0 6px;
}

.remainder-text {
    color: #dc2626;
    font-size: 0.68rem;
}

/* ============================
   imexc.php - unified table styles
============================ */
.unified-table {
    font-size: 0.78rem;
    min-width: 100%;
}

.th-stock-group {
    background: #e91e63 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    border-right: 3px solid #fff;
    text-align: center;
}
.th-stock-group-alt {
    background: #1565c0 !important;
}

.th-sub {
    background: #2d3748 !important;
    color: #cbd5e1 !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    padding: 6px 8px !important;
}

.th-totals {
    background: #fbbf24 !important;
    color: #78350f !important;
    font-weight: 700 !important;
}

.month-cell {
    background: #f3f4f6;
    font-weight: 600;
    color: #1a1a2e;
}

.bought-detail {
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 400;
}

.reinvest-detail {
    color: #059669;
    font-weight: 600;
}

.year-stock-summary {
    display: inline-block;
    margin: 0 10px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.85rem;
}
.year-stock-summary strong { color: #fbbf24; }

.rhc-stocks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    justify-content: center;
}
.stock-pill {
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.btn-mini {
    margin-right: 12px;
    padding: 4px 12px;
    background: rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    color: #78350f;
}
.btn-mini:hover { background: rgba(0,0,0,0.2); }

.btn-reset {
    display: inline-block;
    margin-right: 10px;
    padding: 12px 24px;
    background: #fff;
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}
.btn-reset:hover { background: #fef2f2; }

.goal-row td {
    background: #ecfdf5 !important;
    font-weight: 600;
}

/* ============================
   imexc.php - Hero Goal Card
============================ */
.hero-goal-card {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f43f5e 100%);
    border-radius: 24px;
    padding: 40px 36px;
    margin-bottom: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(124,58,237,0.3);
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(251,191,36,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.hero-goal-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.hero-goal-circle-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.hero-goal-svg {
    width: 100%;
    height: 100%;
}

.progress-circle {
    transition: stroke-dashoffset 1.2s ease-out;
}

.hero-goal-percent {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-percent-num {
    font-size: 3.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.hero-percent-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 6px;
}

.hero-goal-info {
    flex: 1;
    min-width: 280px;
}

.hero-goal-title {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 10px;
    font-weight: 500;
}

.hero-goal-amount {
    margin-bottom: 24px;
}

.hero-amount-num {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
    color: #fff;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-amount-currency {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 8px;
    font-weight: 500;
}

.hero-goal-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    padding: 10px 16px;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    font-size: 0.9rem;
}

.hero-stat-row.reached {
    background: rgba(16,185,129,0.3);
    border: 1px solid rgba(16,185,129,0.5);
}

.hero-stat-row.pending {
    background: rgba(251,191,36,0.2);
}

.hero-stat-icon { font-size: 1.1rem; }
.hero-stat-text { opacity: 0.95; }
.hero-stat-row strong { font-size: 1.1rem; }
.hero-stat-extra { opacity: 0.8; font-size: 0.85rem; margin-right: 4px; }

/* Journey */
.hero-journey {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.hero-journey-title {
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-weight: 600;
    opacity: 0.95;
}

.hero-journey-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journey-row {
    display: grid;
    grid-template-columns: 60px 1fr 80px;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.journey-year {
    font-weight: 700;
    opacity: 0.95;
}

.journey-bar-wrap {
    height: 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    overflow: hidden;
}

.journey-bar {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #fff);
    border-radius: 6px;
    transition: width 1s ease-out;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.journey-row.journey-reached .journey-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 12px rgba(16,185,129,0.6);
}

.journey-pct {
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ============================
   Compact Summary Cards
============================ */
.compact-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.compact-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f3f4f6;
    transition: 0.2s;
}

.compact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.cc-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    border-radius: 10px;
    flex-shrink: 0;
}

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

.cc-label {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.cc-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

.cc-value.pos { color: #059669; }
.cc-value.neg { color: #dc2626; }

/* Stocks list row */
.stocks-list-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.stocks-list-label {
    font-weight: 700;
    color: #1a1a2e;
}

.stocks-list-row .stock-pill {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* New tags */
.lump-tag {
    display: inline-block;
    color: #7c3aed;
    font-weight: 600;
    margin-top: 2px;
    font-size: 0.7rem;
}

.rem-detail {
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 400;
}

/* Mobile */
@media (max-width: 768px) {
    .hero-goal-card { padding: 24px 18px; }
    .hero-goal-content { gap: 20px; }
    .hero-goal-circle-wrap { width: 160px; height: 160px; margin: 0 auto; }
    .hero-percent-num { font-size: 2.5rem; }
    .hero-amount-num { font-size: 2.5rem; }
    .compact-summary { grid-template-columns: repeat(2, 1fr); }
    .cc-value { font-size: 1.1rem; }
}

/* ============================
   Export Buttons - Premium
============================ */
.report-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.export-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.export-label {
    font-weight: 700;
    color: #1a1a2e;
    margin-left: 4px;
    font-size: 0.95rem;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.btn-export:active {
    transform: translateY(0);
}

.btn-excel { background: linear-gradient(135deg, #10b981, #059669); }
.btn-pdf   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-image { background: linear-gradient(135deg, #f59e0b, #d97706); }
.btn-print { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.btn-share { background: linear-gradient(135deg, #ec4899, #be185d); }

/* ============================
   Loading Overlay
============================ */
.export-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.export-loading-box {
    background: #fff;
    padding: 36px 50px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    min-width: 280px;
}

.export-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border: 5px solid #fce7f3;
    border-top-color: #e91e63;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

.export-loading-msg {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* ============================
   Export Mode (for image/pdf)
============================ */
.export-mode {
    background: #f9fafb;
    padding: 30px;
}
.export-mode .report-actions {
    display: none !important;
}

/* ============================
   Print Mode
============================ */
@media print {
    body * {
        visibility: hidden;
    }
    .report-wrapper, .report-wrapper * {
        visibility: visible;
    }
    .report-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .report-actions {
        display: none !important;
    }
    .navbar, .container > h2, .form-wrapper, .edit-btn-wrapper {
        display: none !important;
    }
    .year-block {
        page-break-inside: avoid;
    }
    .hero-goal-card {
        page-break-after: always;
    }
    .compact-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

@page {
    size: A4 portrait;
    margin: 10mm;
}

/* Mobile adjustments for export buttons */
@media (max-width: 600px) {
    .export-group {
        justify-content: center;
        width: 100%;
    }
    .btn-export {
        flex: 1;
        min-width: 80px;
        padding: 10px 8px;
        font-size: 0.78rem;
    }
    .export-label {
        flex: 1 1 100%;
        text-align: center;
        margin-bottom: 6px;
    }
}

/* ============================
   Auth pages (login/register/install)
============================ */
.auth-wrapper {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.auth-card {
    background: #fff;
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 440px;
}
.install-card { max-width: 540px; }

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-icon {
    display: inline-block;
    font-size: 3rem;
    margin-bottom: 8px;
}

.auth-header h2 {
    color: #1a1a2e;
    margin: 8px 0 4px;
    font-size: 1.5rem;
}

.auth-sub {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.auth-form .form-row {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"],
.auth-form input[type="number"],
.auth-form input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    transition: border 0.2s;
    box-sizing: border-box;
    color: #1a1a2e !important;
    background: #fff !important;
}

.auth-form input::placeholder {
    color: #9ca3af;
}

.auth-form input:focus {
    outline: none;
    border-color: #e91e63;
}

.form-hint {
    display: block;
    color: #9ca3af;
    font-size: 0.78rem;
    margin-top: 4px;
}

.form-row-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-row-checkbox label {
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    cursor: pointer;
}

.btn-auth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: 0.2s;
}
.btn-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(233,30,99,0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    color: #6b7280;
    font-size: 0.9rem;
}
.auth-footer a {
    color: #e91e63;
    font-weight: 700;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 0.9rem;
}
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-right: 4px solid #ef4444;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-right: 4px solid #f59e0b;
}
.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-right: 4px solid #10b981;
}
.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-right: 4px solid #3b82f6;
}

.install-info {
    background: #fffbeb;
    padding: 12px 16px;
    border-radius: 10px;
    color: #92400e;
    margin-bottom: 18px;
    font-size: 0.9rem;
    border-right: 4px solid #f59e0b;
}
.install-success {
    text-align: center;
}
.install-success h3 {
    color: #059669;
    margin-bottom: 12px;
}
.install-steps {
    text-align: right;
    margin: 16px 0;
    line-height: 2;
    color: #1a1a2e;
}
.install-steps li {
    padding: 6px 0;
}

/* Navbar additions */
.nav-user {
    color: #e91e63;
    font-weight: 700;
    padding: 6px 12px;
    background: #fce7f3;
    border-radius: 20px;
    font-size: 0.88rem;
}
.nav-logout {
    color: #ef4444 !important;
}
.nav-left a.nav-login {
    background: #e91e63 !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 8px !important;
    font-weight: 700;
}
.nav-left a.nav-login:hover {
    background: #c2185b !important;
    color: #fff !important;
}
.nav-left a.nav-admin {
    background: #1a1a2e !important;
    color: #fbbf24 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
}
.nav-left a.nav-admin:hover {
    background: #2a2a4e !important;
    color: #fbbf24 !important;
}
.logo-link {
    text-decoration: none;
}

/* ============================
   Admin Dashboard
============================ */
.admin-header {
    margin-bottom: 24px;
}
.admin-header h2 {
    color: #1a1a2e;
    margin-bottom: 4px;
}
.admin-subtitle {
    color: #6b7280;
    margin: 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #f3f4f6;
    transition: 0.2s;
}
.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.admin-stat-wide {
    grid-column: span 2;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
}

.ascat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
.ascat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
}
.admin-stat-wide .ascat-value { color: #fff; }

.ascat-label {
    color: #6b7280;
    font-size: 0.85rem;
}
.admin-stat-wide .ascat-label { color: rgba(255,255,255,0.9); }

.admin-section {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.admin-section h3 {
    color: #1a1a2e;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid #e91e63;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.admin-table th {
    background: #1a1a2e;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}
.admin-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}
.admin-table tr:hover td { background: #fdf2f6; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}
.badge-admin {
    background: #1a1a2e;
    color: #fbbf24;
}
.badge-user {
    background: #e0e7ff;
    color: #3730a3;
}
.badge-info {
    background: #fef3c7;
    color: #78350f;
    margin-right: 4px;
}

.admin-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

.btn-mini-action {
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-toggle    { background: #6366f1; color: #fff; }
.btn-reset-pwd { background: #f59e0b; color: #fff; }
.btn-delete    { background: #ef4444; color: #fff; }
.btn-mini-action:hover { transform: translateY(-1px); }

.text-muted {
    color: #9ca3af;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .admin-stat-wide { grid-column: span 1; }
    .admin-actions { flex-direction: column; }
    .admin-actions .btn-mini-action { width: 100%; }
}

/* Install page section titles */
.install-section-title {
    color: #e91e63;
    margin: 24px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #fce7f3;
    font-size: 1.05rem;
}
.install-section-title:first-of-type { margin-top: 16px; }

.install-success p {
    color: #6b7280;
    margin: 12px 0;
}

.install-success code,
.install-info code {
    background: #fce7f3;
    color: #be185d;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

/* ============================
   Smart Stock Search (SAHMK)
============================ */
.stock-search-wrap {
    position: relative;
    margin-bottom: 14px;
}

#stockSearch {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #fce7f3;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e91e63"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 12px center;
    background-size: 18px;
    padding-left: 38px;
    box-sizing: border-box;
}

#stockSearch:focus {
    outline: none;
    border-color: #e91e63;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #fce7f3;
    border-radius: 10px;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    display: none;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f9fafb;
    transition: 0.15s;
}
.search-result-item:hover {
    background: #fdf2f6;
}
.search-result-item:last-child { border-bottom: none; }

.srt-name {
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.srt-meta {
    display: flex;
    gap: 8px;
    font-size: 0.78rem;
}

.srt-symbol {
    background: #e91e63;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-family: monospace;
}

.srt-market {
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.search-loading,
.search-empty {
    padding: 14px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ============================
   Update Prices Button & Result
============================ */
.nav-update-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 8px;
    font-weight: 700 !important;
}
.nav-update-btn:hover {
    transform: translateY(-1px);
}

.update-result {
    background: #fff;
    margin: 16px 0;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.update-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 1.05rem;
}

.update-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.update-table th {
    background: #1a1a2e;
    color: #fff;
    padding: 10px;
    font-weight: 600;
    font-size: 0.88rem;
}
.update-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}
.update-table tr:hover td {
    background: #fdf2f6;
}

.update-failed {
    margin: 8px 0;
    padding-right: 24px;
    color: #6b7280;
    font-size: 0.88rem;
}
.update-failed li {
    padding: 4px 0;
}

.btn-reload {
    margin-top: 16px;
    padding: 10px 20px;
    background: #e91e63;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}
.btn-reload:hover {
    background: #c2185b;
}

/* ============================
   Admin Tabs
============================ */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #f3f4f6;
    flex-wrap: wrap;
}

.admin-tab {
    padding: 12px 22px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.admin-tab:hover {
    color: #1a1a2e;
    background: #fdf2f6;
    border-radius: 8px 8px 0 0;
}

.admin-tab.active {
    color: #e91e63;
    border-bottom-color: #e91e63;
}

.tab-badge {
    background: #fce7f3;
    color: #be185d;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.admin-tab.active .tab-badge {
    background: #e91e63;
    color: #fff;
}

.tab-badge-warn {
    background: #f59e0b !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    width: 22px;
    height: 22px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
}

/* ============================
   Status List (Overview)
============================ */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #f9fafb;
    border-right: 4px solid #e5e7eb;
}

.status-item.status-ok {
    background: #ecfdf5;
    border-right-color: #10b981;
}
.status-item.status-warn {
    background: #fffbeb;
    border-right-color: #f59e0b;
}

.status-icon {
    font-size: 1.4rem;
}

.status-info {
    flex: 1;
}
.status-info strong {
    display: block;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.status-info small {
    color: #6b7280;
    font-size: 0.85rem;
}

.status-action {
    padding: 6px 14px;
    background: #e91e63;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: 0.2s;
}
.status-action:hover {
    background: #c2185b;
}

/* ============================
   Settings Cards
============================ */
.setting-card {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: 0.2s;
}
.setting-card:hover {
    border-color: #fce7f3;
    background: #fff;
}

.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.setting-header h4 {
    color: #1a1a2e;
    margin: 0 0 4px;
    font-size: 1.05rem;
}
.setting-header small {
    color: #6b7280;
    font-size: 0.85rem;
}

.btn-link {
    padding: 6px 14px;
    background: #fce7f3;
    color: #be185d;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-link:hover {
    background: #e91e63;
    color: #fff;
}

.setting-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.setting-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
    direction: ltr;
    text-align: left;
    background: #fff;
}
.setting-input:focus {
    outline: none;
    border-color: #e91e63;
}

.btn-icon {
    padding: 0 14px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}
.btn-icon:hover {
    border-color: #e91e63;
    background: #fdf2f6;
}

.setting-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-save {
    padding: 10px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-test {
    padding: 10px 20px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-test:hover {
    background: #4f46e5;
}

.test-result {
    font-size: 0.88rem;
    padding-right: 8px;
    flex: 1;
    min-width: 100%;
    margin-top: 4px;
}
.test-ok      { color: #059669; font-weight: 700; }
.test-fail    { color: #dc2626; font-weight: 700; }
.test-loading { color: #6b7280; }

/* Settings list */
.settings-list {
    margin: 16px 0;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
}

.setting-row-info {
    flex: 1;
}
.setting-row-info strong {
    display: block;
    color: #1a1a2e;
    font-family: monospace;
}
.setting-row-info small {
    color: #6b7280;
    font-size: 0.82rem;
}

.setting-row-value code {
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #be185d;
    border: 1px solid #fce7f3;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 24px;
    font-style: italic;
}

.add-setting-details {
    margin-top: 20px;
}

.btn-add-setting {
    cursor: pointer;
    padding: 12px 18px;
    background: #fdf2f6;
    color: #e91e63;
    border-radius: 8px;
    font-weight: 700;
    list-style: none;
    transition: 0.2s;
    user-select: none;
    border: 2px dashed #fce7f3;
}
.btn-add-setting:hover {
    background: #fce7f3;
    border-color: #e91e63;
}
.btn-add-setting::-webkit-details-marker { display: none; }

/* Form row inside settings */
.setting-form .form-row {
    margin-bottom: 12px;
}
.setting-form .form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.9rem;
}
.setting-form .form-row input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    box-sizing: border-box;
}
.setting-form .form-row input:focus {
    outline: none;
    border-color: #e91e63;
}

@media (max-width: 600px) {
    .setting-header { flex-direction: column; }
    .admin-tab { flex: 1; justify-content: center; padding: 12px 8px; font-size: 0.85rem; }
}

/* ============================
   Code Input (verification)
============================ */
.code-input {
    text-align: center !important;
    font-size: 2rem !important;
    font-weight: 900 !important;
    letter-spacing: 12px !important;
    direction: ltr !important;
    font-family: 'Courier New', monospace !important;
}

.resend-form {
    text-align: center;
    margin: 20px 0;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.btn-resend {
    background: transparent;
    color: #e91e63;
    border: 2px solid #fce7f3;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-resend:hover {
    background: #fdf2f6;
    border-color: #e91e63;
}

.resend-hint {
    display: block;
    color: #9ca3af;
    margin-top: 8px;
    font-size: 0.78rem;
}

/* ============================
   SMTP Settings Grid
============================ */
.smtp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.smtp-grid .form-row-full {
    grid-column: span 2;
}

.smtp-grid .form-row {
    margin-bottom: 0;
}

.smtp-grid select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    background: #fff;
    box-sizing: border-box;
}

.smtp-grid select:focus {
    outline: none;
    border-color: #e91e63;
}

@media (max-width: 600px) {
    .smtp-grid {
        grid-template-columns: 1fr;
    }
    .smtp-grid .form-row-full {
        grid-column: span 1;
    }
}

/* ============================
   Stock Details Modal
============================ */
.modal-large {
    max-width: 900px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
}

.btn-details {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-details:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.stock-name-cell {
    font-weight: 700;
    color: #1a1a2e;
}

.details-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.details-title h2 {
    color: #1a1a2e;
    margin: 0 0 4px;
    font-size: 1.5rem;
}

.details-sub {
    color: #6b7280;
    margin: 0 0 16px;
}

.details-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ds-card {
    background: linear-gradient(135deg, #fdf2f6, #fce7f3);
    padding: 14px;
    border-radius: 10px;
    text-align: center;
}

.ds-card span {
    display: block;
    color: #be185d;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ds-card strong {
    display: block;
    color: #1a1a2e;
    font-size: 1.3rem;
    font-weight: 800;
}

.details-section {
    margin-top: 24px;
}

.details-section h3 {
    color: #1a1a2e;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 3px solid #e91e63;
    font-size: 1.05rem;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.details-table th {
    background: #1a1a2e;
    color: #fff;
    padding: 10px 8px;
    font-weight: 600;
    font-size: 0.82rem;
    text-align: center;
}

.details-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}

.details-table tr:hover td {
    background: #fdf2f6;
}

.badge-tx-new {
    background: #d1fae5;
    color: #065f46;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-tx-div {
    background: #dbeafe;
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-edit-mini {
    background: #6366f1;
    color: #fff;
    margin-left: 4px;
}
.btn-edit-mini:hover { background: #4f46e5; }

.btn-delete-mini {
    background: #ef4444;
    color: #fff;
}
.btn-delete-mini:hover { background: #dc2626; }

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 24px;
    font-style: italic;
    background: #f9fafb;
    border-radius: 10px;
    margin: 0;
}

/* ============================
   Edit Form Overlay
============================ */
.edit-form-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.edit-form-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease;
}

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

.edit-form-card h3 {
    margin: 0 0 20px;
    color: #1a1a2e;
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 2px solid #fce7f3;
}

.edit-form-card .form-row {
    margin-bottom: 16px;
}

.edit-form-card label {
    display: block;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.edit-form-card input,
.edit-form-card select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: #fff;
}

.edit-form-card input:focus,
.edit-form-card select:focus {
    outline: none;
    border-color: #e91e63;
}

.edit-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.edit-form-actions .btn-save {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.2s;
}
.edit-form-actions .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16,185,129,0.35);
}

.btn-cancel {
    padding: 12px 22px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-cancel:hover {
    background: #e5e7eb;
    color: #1a1a2e;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .modal-large { 
        width: 100% !important; 
        max-width: 100% !important;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    .details-table {
        font-size: 0.78rem;
    }
    .details-table th,
    .details-table td {
        padding: 8px 4px;
    }
    .details-summary {
        grid-template-columns: 1fr;
    }
}

/* ============================
   رابط "تعلّم عائد" في النافبار
============================ */
/* ============================
   رابط "تعلّم عائد" في النافبار
============================ */
.nav-left a.nav-learn {
    background: linear-gradient(135deg, #7c3aed, #ec4899) !important;
    color: #fff !important;
    padding: 7px 14px !important;
    border-radius: 8px !important;
    font-weight: 700;
    font-size: 0.88rem;
    margin-right: 14px;
    margin-left: 4px;
    transition: 0.2s;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
}

.nav-left a.nav-learn:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ============================
   مزايا التثبيت
============================ */
.install-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}

.install-feature-item {
    background: linear-gradient(135deg, #fdf2f6, #fce7f3);
    padding: 14px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #fce7f3;
}

.install-feature-item strong {
    display: block;
    color: #be185d;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.install-feature-item span {
    color: #6b7280;
    font-size: 0.85rem;
}

@media (max-width: 500px) {
    .install-features {
        grid-template-columns: 1fr;
    }
}

/* ============================
   شريط تقدم التعلم في admin
============================ */
.learn-progress-bar {
    position: relative;
    background: #e5e7eb;
    height: 22px;
    border-radius: 11px;
    overflow: hidden;
    min-width: 120px;
}

.learn-progress-fill {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 11px;
}

.learn-progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a1a2e;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* بطاقات المعلومات */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.info-card-item {
    background: #f9fafb;
    padding: 14px 16px;
    border-radius: 10px;
    border-right: 3px solid #ec4899;
}

.info-card-item strong {
    display: block;
    color: #374151;
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.info-card-item span {
    color: #1a1a2e;
    font-weight: 700;
}

.info-card-item a {
    color: #ec4899;
    text-decoration: none;
}

/* badges في جدول التعلم */
.badge-success {
    background: #d1fae5;
    color: #065f46;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
}

/* ============================
   Modal بشكل أحلى — للإضافة
   (يطابق ستايل تعديل المعاملة)
============================ */
.modal-content.modal-form-styled {
    max-width: 520px;
    padding: 28px 26px;
}

.modal-form-styled h3 {
    margin: 0 0 20px;
    color: #1a1a2e;
    font-size: 1.25rem;
    border-bottom: 2px solid #fce7f3;
    padding-bottom: 12px;
}

.modal-form-styled .form-row {
    margin-bottom: 16px;
}

.modal-form-styled label {
    display: block;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin-bottom: 6px !important;
    font-size: 0.9rem !important;
}

.modal-form-styled input[type="text"],
.modal-form-styled input[type="number"],
.modal-form-styled input[type="datetime-local"],
.modal-form-styled select {
    width: 100% !important;
    padding: 11px 14px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 0.95rem !important;
    box-sizing: border-box !important;
    background: #fff !important;
    color: #1a1a2e !important;
    margin: 0 !important;
}

.modal-form-styled input:focus,
.modal-form-styled select:focus {
    outline: none !important;
    border-color: #e91e63 !important;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1) !important;
}

.modal-form-styled .form-hint {
    display: block;
    color: #9ca3af;
    font-size: 0.78rem;
    margin-top: 4px;
}

/* صف فيه عمودين */
.modal-form-styled .form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-form-styled .form-row-grid .form-row {
    margin-bottom: 16px;
}

/* أزرار الحفظ والإلغاء */
.modal-form-styled .edit-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.modal-form-styled .btn-save,
.modal-form-styled .btn-cancel {
    flex: 1;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.2s !important;
}

.modal-form-styled .btn-save {
    background: linear-gradient(135deg, #e91e63, #c2185b) !important;
    color: #fff !important;
}

.modal-form-styled .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.modal-form-styled .btn-cancel {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}

.modal-form-styled .btn-cancel:hover {
    background: #e5e7eb !important;
}

/* استجابة للموبايل */
@media (max-width: 500px) {
    .modal-form-styled .form-row-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ============================
   تنسيق حقل التاريخ والوقت
   (datetime-local) — للأشكال الحلوة
============================ */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    direction: ltr;
    text-align: right;
}

/* أيقونة التقويم — تعطيها لون جميل */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    filter: invert(20%) sepia(80%) saturate(2000%) hue-rotate(310deg);
}

input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* تركيز جميل عند الضغط */
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="time"]:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.12);
    outline: none;
    background: #fff;
}

/* داخل الـ modals — تأكد من التنسيق */
.modal-content input[type="datetime-local"],
.modal-content input[type="date"],
.modal-content input[type="time"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.92rem;
    background: #fafafa;
    margin: 3px 0 10px;
    box-sizing: border-box;
    color: #1a1a2e;
}

.modal-content input[type="datetime-local"]:focus,
.modal-content input[type="date"]:focus,
.modal-content input[type="time"]:focus {
    border-color: #e91e63;
    background: #fff;
}

/* داخل edit-form-card (التعديل) */
.edit-form-card input[type="datetime-local"],
.edit-form-card input[type="date"],
.edit-form-card input[type="time"] {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: #fff;
    color: #1a1a2e;
}

/* ============================
   جدول قابل للترتيب (Sortable)
============================ */
.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    position: relative;
}

.sortable-table th.sortable:hover {
    background: #fce7f3;
    color: #be185d;
}

.sort-icon {
    display: inline-block;
    font-size: 0.85rem;
    margin-right: 4px;
    color: #9ca3af;
    transition: color 0.2s;
    font-weight: 700;
}

.sort-icon.active {
    color: #e91e63;
    font-size: 1rem;
}

.sortable-table th.sortable:hover .sort-icon {
    color: #be185d;
}
