/* ── RESET & BASE ───────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
body{font-family:'Roboto',sans-serif;background:#e2e4e9;color:#212529;font-size:14px;min-height:100vh;}

/* ── TOPBAR ─────────────────────────────────────── */
.topbar{background:#fff;height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid #e2e4e8;position:sticky;top:0;z-index:200;}
.logo{display:flex;align-items:center;gap:11px;text-decoration:none;}
.logo-img{width:38px;height:38px;border-radius:4px;overflow:hidden;flex-shrink:0;background:#1e2257;display:flex;align-items:center;justify-content:center;}
.logo-img img{width:100%;height:100%;object-fit:cover;display:block;}
.logo-img-text{color:#fff;font-weight:700;font-size:.9rem;letter-spacing:.05em;}
.logo-text{font-size:1.05rem;font-weight:500;color:#212529;}
.user-btn{background:#3d47c9;color:#fff;border:none;border-radius:5px;padding:8px 16px;font-size:.84rem;font-weight:500;font-family:'Roboto',sans-serif;cursor:pointer;display:flex;align-items:center;gap:8px;position:relative;}
.user-btn svg{width:14px;height:14px;fill:currentColor;}
.dropdown{display:none;position:absolute;top:calc(100% + 4px);right:0;background:#fff;border:1px solid #e2e4e8;border-radius:5px;min-width:170px;box-shadow:0 4px 12px rgba(0,0,0,.1);z-index:300;}
.user-btn:hover .dropdown,.user-btn:focus-within .dropdown{display:block;}
.dropdown a,.dropdown button{display:block;width:100%;text-align:left;padding:9px 14px;font-size:.84rem;color:#212529;text-decoration:none;background:none;border:none;font-family:'Roboto',sans-serif;cursor:pointer;transition:background .12s;}
.dropdown a:hover,.dropdown button:hover{background:#f4f5ff;}
.dropdown hr{border:none;border-top:1px solid #eee;margin:4px 0;}

/* ── NAVBAR ─────────────────────────────────────── */
.navbar{background:#1e2257;height:42px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:56px;z-index:190;}
.nav-links{display:flex;list-style:none;height:100%;}
.nav-links li{height:100%;display:flex;align-items:center;position:relative;}
.nav-links a,.nav-links>li>button{display:flex;align-items:center;gap:5px;height:100%;padding:0 14px;font-size:.76rem;font-weight:500;letter-spacing:.07em;text-transform:uppercase;color:#c8cde6;text-decoration:none;background:none;border:none;font-family:'Roboto',sans-serif;cursor:pointer;transition:background .15s,color .15s;white-space:nowrap;}
.nav-links a:hover,.nav-links>li>button:hover,.nav-links li.active>a{background:rgba(255,255,255,.08);color:#fff;}
.nav-links svg{width:12px;height:12px;fill:currentColor;}
.sub-menu{display:none;position:absolute;top:100%;left:0;background:#fff;border:1px solid #e2e4e8;border-radius:5px;min-width:190px;box-shadow:0 4px 12px rgba(0,0,0,.1);z-index:300;}
.nav-links li:hover .sub-menu{display:block;}
.sub-menu a{display:block;padding:9px 16px;font-size:.83rem;color:#212529;text-decoration:none;text-transform:none;letter-spacing:0;font-weight:400;height:auto;background:none;transition:background .12s;}
.sub-menu a:hover{background:#f4f5ff;color:#3d47c9;}
.nav-badges{display:flex;gap:6px;align-items:center;}
.badge{font-size:.72rem;font-weight:700;letter-spacing:.06em;padding:4px 12px;border-radius:4px;text-transform:uppercase;cursor:pointer;border:none;font-family:'Roboto',sans-serif;transition:opacity .15s;}
.badge:hover{opacity:.85;}
.badge-staff{background:#4a4a6a;color:#fff;}
.badge-iris{background:#e53935;color:#fff;}

/* ── PAGE WRAP ──────────────────────────────────── */
.page-wrap{max-width:1200px;margin:28px auto;padding:0 20px;}

/* ── CARDS ──────────────────────────────────────── */
.card{background:#fff;border-radius:8px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.06);}
.card-pad{padding:24px 28px;}
.section-card{background:#fff;border-radius:8px;border:1px solid #eaecf0;overflow:hidden;margin-bottom:16px;}
.section-head{padding:14px 20px;border-bottom:1px solid #f0f1f5;display:flex;align-items:center;justify-content:space-between;}
.section-head h2{font-size:.9rem;font-weight:700;color:#1e2257;}
.section-head-actions{display:flex;gap:6px;}

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header{background:#fff;border-radius:8px;padding:22px 28px;margin-bottom:20px;box-shadow:0 1px 3px rgba(0,0,0,.06);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;}
.page-header-left h1{font-size:1.4rem;font-weight:700;color:#111;margin-bottom:3px;}
.page-header-left p{font-size:.88rem;color:#777;}
.page-header-actions{display:flex;gap:8px;flex-wrap:wrap;}

/* ── BUTTONS ────────────────────────────────────── */
.btn{display:inline-flex;align-items:center;gap:7px;border:none;border-radius:5px;padding:9px 20px;font-size:.86rem;font-weight:500;font-family:'Roboto',sans-serif;cursor:pointer;transition:background .15s,opacity .15s;text-decoration:none;white-space:nowrap;}
.btn svg{width:16px;height:16px;fill:currentColor;flex-shrink:0;}
.btn-primary{background:#3d47c9;color:#fff;} .btn-primary:hover{background:#2b31b5;}
.btn-danger{background:#e53935;color:#fff;}  .btn-danger:hover{background:#c62828;}
.btn-success{background:#2e7d32;color:#fff;} .btn-success:hover{background:#1b5e20;}
.btn-warning{background:#f57f17;color:#fff;} .btn-warning:hover{background:#e65100;}
.btn-ghost{background:transparent;color:#3d47c9;border:1px solid #3d47c9;} .btn-ghost:hover{background:#f0f1ff;}
.btn-secondary{background:#f0f1f5;color:#555;border:1px solid #e2e4e8;} .btn-secondary:hover{background:#e5e7ef;}
.btn-sm{padding:6px 14px;font-size:.8rem;}
.btn-xs{padding:4px 10px;font-size:.75rem;}
.btn-icon{padding:7px;background:transparent;border:1px solid #e2e4e8;border-radius:5px;color:#555;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .15s;}
.btn-icon:hover{background:#f4f5ff;color:#3d47c9;border-color:#c5caef;}
.btn-icon svg{width:16px;height:16px;fill:currentColor;}
.btn:disabled{opacity:.5;cursor:not-allowed;}

/* ── FORMS ──────────────────────────────────────── */
.form-group{margin-bottom:16px;}
.form-label{display:block;font-size:.82rem;font-weight:600;color:#444;margin-bottom:5px;}
.form-input,.form-select,.form-textarea{width:100%;border:1px solid #ced4da;border-radius:5px;font-size:.88rem;font-family:'Roboto',sans-serif;color:#212529;background:#fff;outline:none;transition:border-color .15s,box-shadow .15s;}
.form-input{height:38px;padding:0 12px;}
.form-textarea{padding:10px 12px;resize:vertical;min-height:100px;}
.form-select{height:38px;padding:0 30px 0 10px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:20px;appearance:none;cursor:pointer;}
.form-input:focus,.form-select:focus,.form-textarea:focus{border-color:#4e59d4;box-shadow:0 0 0 3px rgba(78,89,212,.15);}
.form-hint{font-size:.76rem;color:#999;margin-top:4px;}
.form-error{font-size:.78rem;color:#c62828;margin-top:4px;}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.form-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;}
.form-check{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:.88rem;}
.form-check input{width:16px;height:16px;cursor:pointer;}
@media(max-width:640px){.form-row,.form-row-3{grid-template-columns:1fr;}}

/* ── TAGS & STATUS ───────────────────────────────── */
.tag{display:inline-block;font-size:.72rem;font-weight:600;padding:2px 10px;border-radius:3px;text-transform:capitalize;}
.tag-active,.tag-completed,.tag-accepted,.tag-hosted{background:#e8f5e9;color:#2e7d32;}
.tag-pending,.tag-reviewing,.tag-upcoming,.tag-planning{background:#fff3e0;color:#e65100;}
.tag-inactive,.tag-past,.tag-general,.tag-archived{background:#f5f5f5;color:#777;}
.tag-suspended,.tag-rejected,.tag-cancelled,.tag-important,.tag-operation,.tag-urgent{background:#fdecea;color:#c62828;}
.tag-training,.tag-information,.tag-in_progress{background:#e8eaff;color:#3d47c9;}
.tag-campaign,.tag-awaiting_whitelist{background:#f3e5f5;color:#7b1fa2;}
.tag-social,.tag-resolved{background:#e0f2f1;color:#00695c;}
.tag-meeting,.tag-ceremony{background:#e3f2fd;color:#1565c0;}
.tag-discharged,.tag-closed,.tag-withdrawn{background:#f5f5f5;color:#999;}
.status-pill{display:inline-flex;align-items:center;gap:5px;font-size:.75rem;font-weight:600;padding:3px 10px;border-radius:20px;text-transform:capitalize;}
.pill-active{background:#e8f5e9;color:#2e7d32;}
.pill-pending{background:#fff3e0;color:#e65100;}
.pill-suspended{background:#fdecea;color:#c62828;}
.pill-inactive,.pill-discharged{background:#f5f5f5;color:#888;}

/* ── STATS GRID ──────────────────────────────────── */
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px;}
.stat-card{background:#fff;border-radius:8px;padding:20px 24px;display:flex;align-items:center;gap:16px;box-shadow:0 1px 3px rgba(0,0,0,.06);}
.stat-icon{width:44px;height:44px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.stat-icon svg{width:22px;height:22px;}
.stat-icon.yellow{background:#fff8e1;} .stat-icon.yellow svg{fill:#f9a825;}
.stat-icon.blue{background:#e8eaff;}   .stat-icon.blue svg{fill:#3d47c9;}
.stat-icon.green{background:#e8f5e9;}  .stat-icon.green svg{fill:#2e7d32;}
.stat-icon.purple{background:#f3e5f5;} .stat-icon.purple svg{fill:#7b1fa2;}
.stat-icon.red{background:#fdecea;}    .stat-icon.red svg{fill:#c62828;}
.stat-icon.teal{background:#e0f2f1;}   .stat-icon.teal svg{fill:#00695c;}
.stat-label{font-size:.82rem;color:#777;margin-bottom:2px;}
.stat-value{font-size:1.6rem;font-weight:700;color:#111;line-height:1;}
.stat-sub{font-size:.75rem;color:#aaa;margin-top:3px;}
@media(max-width:900px){.stats-grid{grid-template-columns:repeat(2,1fr);}}
@media(max-width:500px){.stats-grid{grid-template-columns:1fr;}}

/* ── TABLE ──────────────────────────────────────── */
.table-wrap{overflow-x:auto;}
table{width:100%;border-collapse:collapse;}
thead th{background:#f8f9fb;padding:10px 16px;text-align:left;font-size:.75rem;font-weight:700;color:#888;text-transform:uppercase;letter-spacing:.06em;border-bottom:1px solid #eee;white-space:nowrap;}
tbody tr{border-bottom:1px solid #f5f5f7;transition:background .1s;}
tbody tr:last-child{border-bottom:none;}
tbody tr:hover{background:#fafbff;}
tbody td{padding:11px 16px;font-size:.86rem;color:#333;vertical-align:middle;}
.td-muted{color:#aaa;font-size:.8rem;}
.td-name{font-weight:600;color:#1e2257;}

/* ── FILTER BAR ──────────────────────────────────── */
.filter-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px;}
.filter-bar .form-input{width:220px;}
.filter-bar .form-select{width:160px;}
.search-wrap{position:relative;}
.search-wrap svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:16px;height:16px;}
.search-wrap .form-input{padding-left:34px;}

/* ── TABS ───────────────────────────────────────── */
.tabs{display:flex;border-bottom:2px solid #e8eaee;margin-bottom:20px;}
.tab{padding:10px 20px;font-size:.86rem;font-weight:500;color:#888;cursor:pointer;border:none;background:none;font-family:'Roboto',sans-serif;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .15s;}
.tab:hover{color:#3d47c9;}
.tab.active{color:#3d47c9;border-bottom-color:#3d47c9;}

/* ── MODAL ──────────────────────────────────────── */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:500;align-items:center;justify-content:center;padding:20px;}
.modal-overlay.open{display:flex;}
.modal{background:#fff;border-radius:10px;width:100%;max-width:560px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2);}
.modal-lg{max-width:760px;}
.modal-xl{max-width:960px;}
.modal-header{padding:20px 24px 16px;border-bottom:1px solid #eee;display:flex;align-items:center;justify-content:space-between;}
.modal-header h3{font-size:1rem;font-weight:700;color:#111;}
.modal-close{background:none;border:none;cursor:pointer;color:#aaa;padding:4px;border-radius:4px;display:flex;}
.modal-close:hover{background:#f5f5f5;color:#333;}
.modal-close svg{width:18px;height:18px;fill:currentColor;}
.modal-body{padding:20px 24px;}
.modal-footer{padding:16px 24px;border-top:1px solid #eee;display:flex;justify-content:flex-end;gap:8px;}

/* ── ALERT ──────────────────────────────────────── */
.alert{padding:12px 16px;border-radius:6px;font-size:.86rem;margin-bottom:16px;display:flex;align-items:flex-start;gap:10px;}
.alert svg{width:16px;height:16px;fill:currentColor;flex-shrink:0;margin-top:1px;}
.alert-info{background:#e8eaff;color:#3d47c9;border:1px solid #c5caef;}
.alert-success{background:#e8f5e9;color:#2e7d32;border:1px solid #a5d6a7;}
.alert-warning{background:#fff8e1;color:#e65100;border:1px solid #ffe082;}
.alert-danger{background:#fdecea;color:#c62828;border:1px solid #ef9a9a;}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state{padding:48px 20px;text-align:center;color:#bbb;}
.empty-state svg{width:48px;height:48px;fill:#e0e2e8;display:block;margin:0 auto 12px;}
.empty-state h3{font-size:.95rem;font-weight:600;color:#ccc;margin-bottom:8px;}
.empty-state p{font-size:.86rem;}

/* ── PAGINATION ─────────────────────────────────── */
.pagination{display:flex;align-items:center;gap:6px;justify-content:center;margin-top:16px;padding:12px;}
.page-btn{min-width:34px;height:34px;border:1px solid #e2e4e8;border-radius:5px;background:#fff;font-size:.84rem;color:#555;cursor:pointer;font-family:'Roboto',sans-serif;transition:all .15s;display:inline-flex;align-items:center;justify-content:center;padding:0 8px;}
.page-btn:hover{border-color:#3d47c9;color:#3d47c9;}
.page-btn.active{background:#3d47c9;color:#fff;border-color:#3d47c9;}
.page-btn:disabled{opacity:.4;cursor:default;}

/* ── TOAST ──────────────────────────────────────── */
#toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:8px;}
.toast{background:#1e2257;color:#fff;padding:12px 20px;border-radius:8px;font-size:.86rem;box-shadow:0 4px 16px rgba(0,0,0,.2);animation:toastIn .2s ease;max-width:320px;}
.toast.toast-success{background:#2e7d32;}
.toast.toast-error{background:#c62828;}
.toast.toast-warning{background:#e65100;}
@keyframes toastIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}

/* ── SPINNER ─────────────────────────────────────── */
.spinner{width:24px;height:24px;border:3px solid #e2e4e8;border-top-color:#3d47c9;border-radius:50%;animation:spin .7s linear infinite;display:inline-block;}
.spinner-sm{width:16px;height:16px;border-width:2px;}
@keyframes spin{to{transform:rotate(360deg);}}
.loading-state{display:flex;align-items:center;justify-content:center;padding:40px;gap:12px;color:#aaa;font-size:.88rem;}

/* ── AVATAR ──────────────────────────────────────── */
.avatar{border-radius:50%;background:#3d47c9;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:700;flex-shrink:0;line-height:1;}
.avatar img{border-radius:50%;object-fit:cover;width:100%;height:100%;}
.avatar-sm{width:32px;height:32px;font-size:.75rem;}
.avatar-md{width:44px;height:44px;font-size:1rem;}
.avatar-lg{width:64px;height:64px;font-size:1.4rem;}
.avatar-xl{width:80px;height:80px;font-size:1.8rem;}

/* ── RANK BADGE ──────────────────────────────────── */
.rank-badge{background:#1e2257;color:#fff;font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:3px;white-space:nowrap;}

/* ── DETAIL GRID ─────────────────────────────────── */
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:0;}
.detail-row{padding:10px 0;border-bottom:1px solid #f5f5f5;display:flex;flex-direction:column;gap:2px;}
.detail-row:last-child{border-bottom:none;}
.detail-label{font-size:.74rem;font-weight:600;color:#aaa;text-transform:uppercase;letter-spacing:.05em;}
.detail-value{font-size:.9rem;color:#222;font-weight:500;}

/* ── PROFILE CARD ────────────────────────────────── */
.profile-card{background:#fff;border-radius:10px;border:1px solid #e8eaee;overflow:hidden;}
.profile-banner{height:72px;background:linear-gradient(135deg,#1e2257 0%,#3d47c9 100%);}
.profile-body{padding:0 20px 20px;}
.profile-avatar-wrap{margin-top:-32px;margin-bottom:12px;}
.profile-name{font-size:1.05rem;font-weight:700;color:#1e2257;line-height:1.2;}
.profile-rank{font-size:.82rem;color:#3d47c9;font-weight:500;margin-bottom:12px;}
.pf-row{display:flex;justify-content:space-between;align-items:center;padding:7px 0;border-bottom:1px solid #f5f5f5;}
.pf-row:last-child{border-bottom:none;}
.pf-label{font-size:.74rem;font-weight:600;color:#aaa;text-transform:uppercase;letter-spacing:.05em;}
.pf-value{font-size:.86rem;color:#333;font-weight:500;text-align:right;}

/* ── UTILS ──────────────────────────────────────── */
.text-muted{color:#aaa;}
.text-small{font-size:.8rem;}
.text-danger{color:#c62828;}
.text-success{color:#2e7d32;}
.flex{display:flex;}
.flex-center{display:flex;align-items:center;gap:8px;}
.flex-between{display:flex;align-items:center;justify-content:space-between;}
.flex-wrap{flex-wrap:wrap;}
.gap-8{gap:8px;}
.gap-12{gap:12px;}
.mt-8{margin-top:8px;}
.mt-16{margin-top:16px;}
.mt-20{margin-top:20px;}
.mb-8{margin-bottom:8px;}
.mb-16{margin-bottom:16px;}
.mb-20{margin-bottom:20px;}
.w-full{width:100%;}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}
@media(max-width:900px){.grid-4{grid-template-columns:1fr 1fr;}.grid-3{grid-template-columns:1fr 1fr;}}
@media(max-width:600px){.grid-2,.grid-3,.grid-4{grid-template-columns:1fr;}}

/* ── RESPONSIVE ──────────────────────────────────── */
@media(max-width:768px){
  .topbar,.navbar{padding:0 16px;}
  .page-wrap{padding:0 12px;margin:16px auto;}
  .hide-mobile{display:none;}
  .page-header{flex-direction:column;align-items:flex-start;}
}
