/* =========================================================
   Rotary DHANYAVAD — Application Stylesheet
   ========================================================= */

:root {
    --rotary-blue:    #17458F;
    --rotary-blue-dk: #0F3266;
    --rotary-blue-lt: #5B9BD5;
    --rotary-gold:    #F7A81B;
    --rotary-cranberry:#D41367;
    --rotary-green:   #279989;
    --rotary-sky:     #5B9BD5;
    --soft-bg:        #F4F7FC;
    --soft-border:    #E5ECF6;
    --txt-base:       #1f2937;
    --txt-muted:      #5a6478;
    --shadow-sm:      0 1px 3px rgba(15,50,102,0.06);
    --shadow:         0 4px 12px rgba(15,50,102,0.08);
}

* { box-sizing: border-box; }
html, body {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--txt-base);
    background: var(--soft-bg);
    margin: 0;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--rotary-blue); }
a:hover { color: var(--rotary-blue-dk); }

/* ================== Sidebar ================== */
.rk-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, var(--rotary-blue-dk) 0%, var(--rotary-blue) 100%);
    color: #fff; overflow-y: auto; z-index: 1040;
    transition: transform .25s ease;
}
.rk-sidebar::-webkit-scrollbar { width: 6px; }
.rk-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.rk-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rk-brand-logo {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--rotary-gold); color: var(--rotary-blue-dk);
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.rk-brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.5px; }
.rk-brand-sub  { font-size: 0.75rem; opacity: 0.7; }

.rk-nav { padding: 12px 10px; }
.rk-nav-section {
    text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em;
    opacity: 0.55; padding: 18px 12px 8px;
}
.rk-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    color: rgba(255,255,255,0.85); text-decoration: none;
    border-radius: 8px; margin-bottom: 2px; font-size: 0.93rem;
    transition: background .15s, color .15s;
}
.rk-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.rk-nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.rk-nav-link.active {
    background: rgba(247,168,27,0.16); color: var(--rotary-gold);
    border-left: 3px solid var(--rotary-gold); padding-left: 11px;
}

.rk-sidebar-foot {
    padding: 18px 20px; opacity: 0.55; font-size: 0.75rem; text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08); margin-top: 12px;
}

/* ================== Main / Topbar ================== */
.rk-main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }
.rk-topbar {
    position: sticky; top: 0; z-index: 1030;
    background: #fff; border-bottom: 1px solid var(--soft-border);
    height: 60px; display: flex; align-items: center; padding: 0 24px;
    box-shadow: var(--shadow-sm);
}
.rk-topbar-title { font-size: 1.05rem; font-weight: 600; margin: 0; color: var(--rotary-blue-dk); }
.rk-topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.rk-bell { position: relative; color: var(--txt-muted); font-size: 1.2rem; text-decoration: none; padding: 6px; }
.rk-bell:hover { color: var(--rotary-blue); }
.rk-bell-dot {
    position: absolute; top: 2px; right: 0;
    background: var(--rotary-cranberry); color: #fff;
    font-size: 0.65rem; padding: 1px 6px; border-radius: 10px; font-weight: 600;
}
.rk-burger { background: var(--soft-bg) !important; border: 0; margin-right: 12px; }
.rk-user-btn {
    background: none; border: 0; padding: 6px 8px;
    display: flex; align-items: center; gap: 10px; border-radius: 8px;
    color: var(--txt-base);
}
.rk-user-btn:hover { background: var(--soft-bg); }
.rk-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--rotary-blue); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem;
}
.rk-avatar-sm { width: 28px; height: 28px; font-size: 0.75rem; }
.rk-avatar-lg { width: 84px; height: 84px; font-size: 2rem; }
.rk-user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.rk-user-name { font-weight: 600; font-size: 0.88rem; }
.rk-user-role { font-size: 0.75rem; color: var(--txt-muted); }

/* ================== Content ================== */
.rk-content { padding: 24px; flex: 1; }
.rk-footer {
    padding: 12px 24px; border-top: 1px solid var(--soft-border);
    background: #fff; font-size: 0.78rem; color: var(--txt-muted);
    display: flex; justify-content: space-between;
}

.page-head {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    flex-wrap: wrap; margin-bottom: 4px;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--rotary-blue-dk); margin: 0; }
.page-sub { font-size: 0.88rem; }

/* ================== Cards ================== */
.card-tk {
    background: #fff; border: 1px solid var(--soft-border);
    border-radius: 12px; box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-tk-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--soft-border);
}
.card-tk-title { font-size: 0.95rem; font-weight: 600; margin: 0; color: var(--rotary-blue-dk); }
.card-tk .table { font-size: 0.88rem; margin-bottom: 0; }
.card-tk .table thead th {
    background: var(--soft-bg); color: var(--txt-muted);
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid var(--soft-border); font-weight: 600;
}
.card-tk .table > :not(caption) > * > * { padding: 0.85rem 1rem; }

.border-rotary { border-color: var(--rotary-blue) !important; }
.bg-rotary-soft { background: rgba(23,69,143,0.07) !important; }
.text-rotary { color: var(--rotary-blue) !important; }
.bg-rotary { background: var(--rotary-blue) !important; color: #fff !important; }
.bg-gold   { background: var(--rotary-gold) !important; }
.bg-cranberry { background: var(--rotary-cranberry) !important; color: #fff !important; }
.text-cranberry { color: var(--rotary-cranberry) !important; }

/* ================== Stat cards ================== */
.stat-card {
    background: #fff; border: 1px solid var(--soft-border); border-radius: 12px;
    padding: 18px; display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm); height: 100%;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; flex-shrink: 0;
}
.stat-blue      .stat-icon { background: var(--rotary-blue); }
.stat-teal      .stat-icon { background: var(--rotary-green); }
.stat-gold      .stat-icon { background: var(--rotary-gold); }
.stat-cranberry .stat-icon { background: var(--rotary-cranberry); }
.stat-label { color: var(--txt-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--rotary-blue-dk); line-height: 1.1; }

/* ================== Buttons ================== */
.btn { border-radius: 8px; font-weight: 500; font-size: 0.88rem; padding: 0.5rem 1rem; }
.btn-rotary {
    background: var(--rotary-blue); color: #fff; border: 1px solid var(--rotary-blue);
}
.btn-rotary:hover, .btn-rotary:focus {
    background: var(--rotary-blue-dk); color: #fff; border-color: var(--rotary-blue-dk);
}
.btn-rotary-outline {
    background: transparent; color: var(--rotary-blue); border: 1px solid var(--rotary-blue);
}
.btn-rotary-outline:hover { background: var(--rotary-blue); color: #fff; }
.btn-light { background: #fff; border-color: var(--soft-border); }
.btn-light:hover { background: var(--soft-bg); }

/* ================== Forms ================== */
.form-label { font-weight: 500; font-size: 0.85rem; color: #374151; margin-bottom: 0.3rem; }
.form-control, .form-select {
    border: 1px solid #dde4f0; border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--rotary-blue); box-shadow: 0 0 0 3px rgba(23,69,143,0.10);
}
.input-group-text { background: var(--soft-bg); border: 1px solid #dde4f0; color: var(--txt-muted); }

/* ================== Tables ================== */
.table { color: var(--txt-base); }
.table > :not(caption) > * > * { border-bottom-color: var(--soft-border); }
.ref-no {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.82rem; background: var(--soft-bg);
    padding: 2px 8px; border-radius: 6px; color: var(--rotary-blue-dk);
    white-space: nowrap;
}

/* ================== Badges (status) ================== */
.badge { font-weight: 500; font-size: 0.72rem; padding: 4px 9px; border-radius: 6px; }
.status-badge { font-size: 0.72rem; padding: 4px 9px; border-radius: 6px; font-weight: 500; display: inline-block; }
.status-draft               { background: #e5e7eb; color: #4b5563; }
.status-submitted           { background: rgba(91,155,213,0.18); color: #1d4ed8; }
.status-under_review        { background: rgba(247,168,27,0.18); color: #b45309; }
.status-approved            { background: rgba(39,153,137,0.16); color: #047857; }
.status-rejected            { background: rgba(212,19,103,0.14); color: #be123c; }
.status-in_execution        { background: rgba(23,69,143,0.14); color: var(--rotary-blue); }
.status-completed           { background: rgba(39,153,137,0.16); color: #047857; }
.status-reimbursement_pending { background: rgba(247,168,27,0.18); color: #b45309; }
.status-reimbursed          { background: rgba(39,153,137,0.18); color: #047857; }
.status-cancelled           { background: #e5e7eb; color: #4b5563; }
.status-changes_requested   { background: rgba(247,168,27,0.18); color: #b45309; }
.status-pending             { background: #e5e7eb; color: #4b5563; }
.status-verified            { background: rgba(91,155,213,0.18); color: #1d4ed8; }
.status-paid                { background: rgba(39,153,137,0.18); color: #047857; }

/* ================== Stage progress ================== */
.stage-progress {
    display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap; margin: 0.5rem 0;
}
.stage-step {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; min-width: 120px; color: var(--txt-muted); font-size: 0.78rem;
}
.stage-bubble {
    width: 38px; height: 38px; border-radius: 50%;
    background: #eef2f9; color: var(--txt-muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; margin-bottom: 6px;
    border: 2px solid #eef2f9;
}
.stage-step.current .stage-bubble { background: var(--rotary-blue); color: #fff; border-color: var(--rotary-blue); box-shadow: 0 0 0 4px rgba(23,69,143,0.15); }
.stage-step.done .stage-bubble    { background: var(--rotary-green); color: #fff; border-color: var(--rotary-green); }
.stage-step.rejected .stage-bubble{ background: var(--rotary-cranberry); color: #fff; border-color: var(--rotary-cranberry); }
.stage-step.current .stage-label  { color: var(--rotary-blue-dk); font-weight: 600; }
.stage-step.done    .stage-label  { color: var(--rotary-green); font-weight: 600; }
.stage-line { flex: 1; height: 2px; background: #eef2f9; min-width: 30px; margin: 19px 0 0; }
.stage-line.done { background: var(--rotary-green); }

/* ================== Timeline ================== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
    width: 2px; background: var(--soft-border);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -22px; top: 4px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--rotary-blue); border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--rotary-blue);
}
.timeline-item.action-approved          .timeline-dot { background: var(--rotary-green); box-shadow: 0 0 0 2px var(--rotary-green); }
.timeline-item.action-rejected          .timeline-dot { background: var(--rotary-cranberry); box-shadow: 0 0 0 2px var(--rotary-cranberry); }
.timeline-item.action-changes_requested .timeline-dot { background: var(--rotary-gold); box-shadow: 0 0 0 2px var(--rotary-gold); }
.timeline-item.action-progress          .timeline-dot { background: var(--rotary-sky); box-shadow: 0 0 0 2px var(--rotary-sky); }
.timeline-content { font-size: 0.9rem; }
.timeline-content .remarks {
    background: var(--soft-bg); padding: 8px 12px; border-radius: 8px;
    margin-top: 6px; font-size: 0.85rem; color: #374151;
    border-left: 3px solid var(--rotary-blue);
}

/* ================== Detail / quick ================== */
.detail-list dt { color: var(--txt-muted); font-weight: 500; font-size: 0.85rem; padding: 0.4rem 0; }
.detail-list dd { padding: 0.4rem 0; font-size: 0.9rem; }
.quick-meta li  { padding: 5px 0; }
.quick-meta i   { width: 18px; color: var(--rotary-blue); }
.att-item { padding: 8px 0; border-bottom: 1px dashed var(--soft-border); }
.att-item:last-child { border-bottom: 0; }
.att-item a { text-decoration: none; font-weight: 500; }

/* ================== Workflow mini ================== */
.workflow-mini { display: flex; flex-direction: column; gap: 6px; }
.wf-step {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; background: var(--soft-bg); border-radius: 6px;
    font-size: 0.83rem; color: var(--rotary-blue-dk); font-weight: 500;
}
.wf-step span {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--rotary-blue); color: #fff;
    font-size: 0.75rem; display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}

/* ================== Category cards ================== */
.cat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}

/* ================== Notifications ================== */
.notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--soft-bg);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* ================== Auth ================== */
.auth-body { background: linear-gradient(135deg, #e8eef9 0%, #f4f7fc 100%); min-height: 100vh; }
.auth-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
    display: grid; grid-template-columns: 1.05fr 1fr;
    max-width: 920px; width: 100%;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(15,50,102,0.15);
}
.auth-hero {
    background: linear-gradient(135deg, var(--rotary-blue-dk) 0%, var(--rotary-blue) 60%, var(--rotary-sky) 100%);
    color: #fff; padding: 44px 38px; position: relative; overflow: hidden;
}
.auth-hero::after {
    content: ''; position: absolute; right: -60px; bottom: -60px;
    width: 220px; height: 220px; background: rgba(247,168,27,0.18);
    border-radius: 50%;
}
.auth-hero-inner { position: relative; z-index: 1; }
.auth-logo {
    width: 60px; height: 60px; border-radius: 16px;
    background: var(--rotary-gold); color: var(--rotary-blue-dk);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; padding: 8px; margin-bottom: 40px;
}
.auth-hero h2 { font-weight: 700; font-size: 1.85rem; letter-spacing: 1px; margin: 0 0 6px; }
.auth-tagline { font-size: 0.92rem; opacity: 0.92; margin-bottom: 24px; }
.auth-bullets { list-style: none; padding: 0; margin: 0 0 26px; font-size: 0.85rem; }
.auth-bullets li { padding: 4px 0; opacity: 0.92; }
.auth-bullets i { color: var(--rotary-gold); margin-right: 8px; }
.auth-pillars { display: flex; gap: 14px; flex-wrap: wrap; }
.auth-pillars span {
    background: rgba(255,255,255,0.12); padding: 6px 12px; border-radius: 20px;
    font-size: 0.75rem; display: inline-flex; align-items: center; gap: 6px;
}
.auth-pillars i { color: var(--rotary-gold); }

.auth-form-side { padding: 44px 38px; display: flex; flex-direction: column; justify-content: center; }
.auth-title { font-weight: 700; color: var(--rotary-blue-dk); margin: 0 0 4px; }
.auth-sub { font-size: 0.9rem; }
.auth-foot { color: var(--txt-muted); font-size: 0.78rem; margin-top: 16px; text-align: center; }
.auth-demo {
    background: var(--soft-bg); border: 1px dashed var(--soft-border);
    border-radius: 10px; padding: 12px; font-size: 0.78rem;
}
.auth-demo-title { font-weight: 600; color: var(--rotary-blue-dk); margin-bottom: 6px; }
.auth-demo-list { list-style: none; padding: 0; margin: 0; }
.auth-demo-list li { padding: 2px 0; color: var(--txt-muted); }
.auth-demo-list strong { color: var(--rotary-blue-dk); }

.err-card {
    background: #fff; border-radius: 16px; padding: 50px 40px;
    text-align: center; box-shadow: var(--shadow); max-width: 460px;
}

/* ================== Alerts ================== */
.alert { border-radius: 10px; border: 0; font-size: 0.9rem; }
.alert-success { background: rgba(39,153,137,0.12); color: #047857; }
.alert-danger  { background: rgba(212,19,103,0.10); color: #be123c; }
.alert-info    { background: rgba(91,155,213,0.14); color: #1e3a8a; }

/* ================== Progress ================== */
.progress { background: #eef2f9; border-radius: 10px; }
.progress-bar.bg-rotary { background: var(--rotary-blue) !important; }
.progress-bar.bg-gold   { background: var(--rotary-gold) !important; }

/* ================== Modals ================== */
.modal-content { border: 0; border-radius: 12px; }
.modal-header  { border-bottom: 1px solid var(--soft-border); }
.modal-footer  { border-top: 1px solid var(--soft-border); }
.modal-title   { color: var(--rotary-blue-dk); font-weight: 600; }

/* ================== Mobile ================== */
@media (max-width: 992px) {
    .rk-sidebar { transform: translateX(-100%); }
    .rk-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.3); }
    .rk-main { margin-left: 0; }
    .rk-content { padding: 16px; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-hero { padding: 30px 28px; }
    .auth-form-side { padding: 28px; }
    .stage-step { min-width: 80px; font-size: 0.7rem; }
    .stage-bubble { width: 32px; height: 32px; }
}

/* =================================================================
   Application form — selectable project cards
   ================================================================= */
.project-card {
    --proj-color: var(--rotary-blue);
    display: block;
    cursor: pointer;
    background: #fff;
    border: 2px solid var(--soft-border);
    border-radius: 14px;
    padding: 18px 18px 14px;
    height: 100%;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--proj-color);
    opacity: 0.4;
    transition: opacity 0.2s;
}
.project-card:hover {
    border-color: var(--proj-color);
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}
.project-card.selected {
    border-color: var(--proj-color);
    background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--proj-color) 6%, #fff));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--proj-color) 18%, transparent);
}
.project-card.selected::before { opacity: 1; height: 6px; }

.project-card .proj-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    position: relative;
}
.project-card .proj-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--proj-color);
    color: #fff;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.project-card .proj-name {
    font-weight: 700;
    color: var(--rotary-blue-dk);
    font-size: 1rem;
    line-height: 1.2;
}
.project-card .proj-tick {
    position: absolute;
    top: -4px; right: -4px;
    font-size: 1.4rem;
    color: var(--proj-color);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s ease;
}
.project-card.selected .proj-tick {
    opacity: 1;
    transform: scale(1);
}
.project-card .proj-desc {
    color: #5a6b85;
    min-height: 38px;
}
.project-card .proj-spec li {
    padding: 2px 0;
    color: #4a5b75;
}
.project-card .proj-spec i {
    color: var(--proj-color);
    margin-right: 6px;
}
.project-card .proj-qty-wrap {
    background: #f8fafd;
    border: 1px dashed var(--soft-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: auto;
}
.project-card .proj-qty:disabled {
    background: #eef0f4;
    opacity: 0.7;
}

/* Outline button matched to Rotary palette */
.btn-outline-rotary {
    color: var(--rotary-blue);
    border-color: var(--rotary-blue);
}
.btn-outline-rotary:hover {
    background: var(--rotary-blue);
    color: #fff;
}
.text-rotary  { color: var(--rotary-blue) !important; }
.bg-rotary    { background-color: var(--rotary-blue) !important; }

/* progress bar colour overrides for the budget meter */
.progress-bar.bg-rotary { background-color: var(--rotary-blue) !important; }

/* Mobile: ensure cards stack neatly */
@media (max-width: 575.98px) {
    .project-card { padding: 14px; }
    .project-card .proj-icon { width: 38px; height: 38px; font-size: 1.2rem; }
    .project-card .proj-name { font-size: 0.95rem; }
}
india-map-frame{
    position: relative;
    width: 100%;
    /* height in px rather than aspect-ratio, since the map's own layout
       is fixed-ish and works best given real vertical room */
    height: 900px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(15, 34, 71, 0.12);
    border: 1px solid rgba(15, 34, 71, 0.08);
}
.india-map-frame iframe{
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
@media (max-width: 768px){
    .india-map-frame{ height: 1400px; } /* map panel stacks under the map on narrow screens */
}
