/* ============================================
   SchoolERP - Materio Inspired Admin Theme
   Light · Clean · Modern (themeselection.com)
   ============================================ */

:root {
    --primary: #7367f0;
    --primary-dark: #685dd8;
    --primary-light: #8f85f3;
    --primary-soft: rgba(115, 103, 240, 0.12);
    --secondary: #a8aaae;
    --success: #28c76f;
    --success-soft: rgba(40, 199, 111, 0.12);
    --warning: #ff9f43;
    --warning-soft: rgba(255, 159, 67, 0.12);
    --danger: #ea5455;
    --danger-soft: rgba(234, 84, 85, 0.12);
    --info: #00cfe8;
    --info-soft: rgba(0, 207, 232, 0.12);

    --bg-body: #f4f5fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #4b465c;
    --text-secondary: #6f6b7d;
    --text-muted: #a5a3ae;
    --text-heading: #4b465c;
    --border-color: #dbdade;
    --divider: #ebe9f1;

    --shadow-xs: 0 1px 4px rgba(165, 163, 174, 0.18);
    --shadow-sm: 0 2px 6px rgba(165, 163, 174, 0.2);
    --shadow-md: 0 4px 18px rgba(75, 70, 92, 0.1);
    --shadow-lg: 0 6px 28px rgba(75, 70, 92, 0.15);
    --shadow-primary: 0 4px 16px rgba(115, 103, 240, 0.4);

    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}

/* ============================================
   LOGIN / AUTH STYLES
   ============================================ */
.login-body { background: linear-gradient(180deg, #eef2ff 0%, #fbfdff 100%); }
.login-container { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding: 48px 20px; }
.login-wrapper { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: stretch; }
.login-wrapper.enter .login-panel-right { animation: slideUpFade .6s cubic-bezier(.2,.9,.2,1); }

.login-panel-left {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; border-radius: 14px; padding: 36px; display:flex; flex-direction:column; gap:18px; box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.login-panel-left .school-logo { width:64px; height:64px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:28px; background: rgba(255,255,255,0.12); }
.login-panel-left h2 { font-size:26px; font-weight:700; margin:6px 0 0; }
.login-panel-left .muted { opacity:0.95; color: rgba(255,255,255,0.92); font-size:14px; }
.login-panel-left .login-features { list-style:none; margin-top:12px; padding:0; display:flex; flex-direction:column; gap:10px; }
.login-panel-left .login-features li { display:flex; gap:12px; align-items:center; font-weight:600; color:rgba(255,255,255,0.95); }
.login-panel-left .login-features li i { color: rgba(255,255,255,0.92); width:34px; height:34px; display:flex; align-items:center; justify-content:center; border-radius:8px; background: rgba(0,0,0,0.06); }

.login-panel-right { background: var(--bg-card); border-radius: 14px; padding: 32px; box-shadow: var(--shadow-md); display:flex; flex-direction:column; justify-content:space-between; }
.login-header h3 { margin:0; font-size:20px; font-weight:700; }
.login-header .muted { color:var(--text-muted); margin-top:6px; }

.login-form { width:100%; max-width:420px; }
.form-floating .input-icon, .input-group-icon { position:relative; }
.input-icon .fa, .input-group-icon .fa { position:absolute; right:14px; top:50%; transform:translateY(-50%); color:var(--text-muted); }
.btn-login { display:flex; align-items:center; gap:10px; justify-content:center; padding:12px 16px; border-radius:10px; font-weight:600; }
.btn-login .btn-icon { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; background: rgba(255,255,255,0.08); border-radius:8px; }
.btn-login .btn-text { margin-left:6px; }

.login-input { padding:1.25rem .75rem; border-radius:10px; border:1px solid var(--divider); transition: box-shadow .18s ease, border-color .18s ease, transform .12s ease; }
.login-input.focused, .login-input:focus { box-shadow: var(--shadow-sm); border-color: var(--primary); transform: translateY(-1px); outline:none; }
.btn-icon-toggle { position:absolute; right:10px; top:10px; background:transparent; border:0; font-size:16px; color:var(--text-muted); }

.login-footer { margin-top:18px; color:var(--text-muted); }

@keyframes slideUpFade { from { opacity:0; transform: translateY(18px); } to { opacity:1; transform: translateY(0); } }

/* Responsive adjustments */
@media (max-width: 991px) {
    .login-wrapper { grid-template-columns: 1fr; }
    .login-panel-left { order:2; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }

/* ============================================
   LAYOUT
   ============================================ */
.admin-layout { display: flex; min-height: 100vh; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    padding: 4px;
    flex: 1;
}

/* ============================================
   SIDEBAR (Materio Style - Light)
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 0 0 12px rgba(75, 70, 92, 0.07);
    border-right: 1px solid var(--divider);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #d6d4dd; border-radius: 10px; }

.sidebar-header {
    padding: 20px 22px;
    position: sticky;
    top: 0;
    background: var(--bg-sidebar);
    z-index: 10;
    border-bottom: 1px solid var(--divider);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-heading);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #fff;
    box-shadow: var(--shadow-primary);
}

.sidebar-brand-text h2 {
    font-size: 18px; font-weight: 700; color: var(--text-heading);
    margin: 0; letter-spacing: 0.3px; text-transform: uppercase;
}

.sidebar-brand-text span {
    font-size: 10px; color: var(--text-muted);
    font-weight: 500; letter-spacing: 0.5px;
}

.sidebar-menu { padding: 14px 14px 30px; }

.menu-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 18px 14px 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    position: relative;
}

.menu-item i { font-size: 16px; width: 20px; text-align: center; }

.menu-item:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.menu-item.active {
    color: #fff;
    background: linear-gradient(72.47deg, var(--primary) 22.16%, var(--primary-light) 76.47%);
    box-shadow: var(--shadow-primary);
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin: 16px 24px 0;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 12px;
    z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.page-title {
    font-size: 18px; font-weight: 600;
    color: var(--text-heading); margin: 0;
}
.page-subtitle {
    font-size: 12px; color: var(--text-muted); margin: 0;
}

.menu-toggle {
    display: none;
    width: 38px; height: 38px;
    border: none; background: transparent;
    border-radius: 8px; cursor: pointer;
    color: var(--text-secondary);
    align-items: center; justify-content: center;
}
.menu-toggle:hover { background: var(--primary-soft); color: var(--primary); }

.search-box {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-muted);
    min-width: 220px;
}
.search-box i { font-size: 14px; }
.search-box input {
    border: none; outline: none; background: transparent;
    font-size: 13px; color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }

.topbar-icon-btn {
    width: 38px; height: 38px;
    background: transparent; border: none;
    border-radius: 50%; cursor: pointer;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}
.topbar-icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.notification-dot {
    position: absolute; top: 8px; right: 9px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-profile {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; padding: 4px 8px;
    border-radius: 8px;
}
.user-profile:hover { background: var(--primary-soft); }
.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    position: relative;
}
.user-avatar::after {
    content: ''; position: absolute; bottom: 0; right: 0;
    width: 10px; height: 10px;
    background: var(--success); border-radius: 50%;
    border: 2px solid var(--bg-card);
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-heading); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ============================================
   CARDS / PANELS
   ============================================ */
.m-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: 22px;
    position: relative;
    transition: box-shadow 0.25s ease;
}
.m-card:hover { box-shadow: var(--shadow-sm); }

.m-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 18px;
}
.m-card-title {
    font-size: 17px; font-weight: 600;
    color: var(--text-heading); margin: 0 0 4px;
}
.m-card-sub { font-size: 13px; color: var(--text-muted); margin: 0; }

.m-card-menu {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 18px;
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.m-card-menu:hover { background: var(--primary-soft); color: var(--primary); }

/* ============================================
   MATERIO DASHBOARD GRID
   ============================================ */
.materio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-8 { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }
.col-span-3 { grid-column: span 3; }

/* Congratulations Card */
.congrats-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
    overflow: hidden;
    min-height: 230px;
    box-shadow: var(--shadow-xs);
}
.congrats-card h5 {
    font-size: 18px; font-weight: 600;
    color: var(--text-heading); margin: 0 0 4px;
}
.congrats-card .sub {
    font-size: 13px; color: var(--text-muted); margin-bottom: 14px;
}
.congrats-card .amount {
    font-size: 26px; font-weight: 700;
    color: var(--primary); margin-bottom: 4px;
}
.congrats-card .target {
    font-size: 12px; color: var(--text-muted); margin-bottom: 18px;
}
.congrats-trophy {
    position: absolute;
    right: 18px; bottom: 18px;
    font-size: 80px;
    color: var(--warning);
    opacity: 0.95;
    line-height: 1;
}
.btn-materio {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    background: var(--primary);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-primary);
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-materio:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-materio.outline {
    background: transparent; color: var(--primary) !important;
    border: 1px solid var(--primary);
    box-shadow: none;
}
.btn-materio.outline:hover { background: var(--primary-soft); }

/* Transactions Card */
.transactions-card { min-height: 230px; }
.transactions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 8px;
}
.tx-item { display: flex; align-items: center; gap: 12px; }
.tx-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.tx-icon.primary { background: var(--primary-soft); color: var(--primary); }
.tx-icon.success { background: var(--success-soft); color: var(--success); }
.tx-icon.warning { background: var(--warning-soft); color: var(--warning); }
.tx-icon.info { background: var(--info-soft); color: var(--info); }
.tx-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.tx-value { font-size: 16px; font-weight: 600; color: var(--text-heading); }
.transactions-card .growth-line {
    font-size: 13px; color: var(--text-muted); margin-bottom: 18px;
}
.growth-line strong { color: var(--text-heading); font-weight: 600; }

/* Weekly Overview Card */
.weekly-card { min-height: 380px; }
.chart-wrap { height: 240px; position: relative; }
.weekly-footer {
    display: flex; align-items: center; gap: 14px;
    margin-top: 14px;
}
.weekly-footer .pct {
    font-size: 22px; font-weight: 700;
    color: var(--text-heading);
}
.weekly-footer .desc {
    font-size: 13px; color: var(--text-muted); flex: 1;
}

/* Total Earning Card */
.earning-card { min-height: 380px; }
.earning-amount {
    font-size: 28px; font-weight: 700;
    color: var(--text-heading);
    display: flex; align-items: center; gap: 8px;
}
.earning-amount .change {
    font-size: 13px; color: var(--success); font-weight: 500;
}
.earning-sub {
    font-size: 13px; color: var(--text-muted);
    margin-top: 4px; margin-bottom: 22px;
}
.earning-list { display: flex; flex-direction: column; gap: 18px; }
.earning-item {
    display: flex; align-items: center; gap: 12px;
}
.earning-item .ic {
    width: 42px; height: 42px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    background: var(--primary-soft);
    color: var(--primary);
}
.earning-item .ic.s2 { background: var(--warning-soft); color: var(--warning); }
.earning-item .ic.s3 { background: var(--info-soft); color: var(--info); }
.earning-item .meta { flex: 1; }
.earning-item .meta .t {
    font-size: 14px; font-weight: 600; color: var(--text-heading);
}
.earning-item .meta .s {
    font-size: 12px; color: var(--text-muted);
}
.earning-item .amt {
    font-size: 14px; font-weight: 600;
    color: var(--text-heading);
}

/* Small Stat Cards (Total Profit / Sessions / New Project) */
.stat-mini {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-xs);
    min-height: 175px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.stat-mini-top {
    display: flex; align-items: center; justify-content: space-between;
}
.stat-mini-icon {
    width: 38px; height: 38px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    background: var(--primary-soft); color: var(--primary);
}
.stat-mini-icon.success { background: var(--success-soft); color: var(--success); }
.stat-mini-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-mini-icon.info { background: var(--info-soft); color: var(--info); }
.stat-mini-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-mini h3 {
    font-size: 22px; font-weight: 700;
    color: var(--text-heading); margin: 8px 0 0;
}
.stat-mini .label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-mini .label.bold { color: var(--text-heading); font-weight: 600; font-size: 14px; }
.stat-mini .change { font-size: 12px; font-weight: 500; }
.stat-mini .change.up { color: var(--success); }
.stat-mini .change.down { color: var(--danger); }
.mini-chart { height: 80px; margin-top: -8px; }

/* Sales by countries */
.country-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
}
.country-row + .country-row { border-top: 1px solid var(--divider); }
.country-flag {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    text-transform: uppercase;
}
.country-info { flex: 1; }
.country-info .v {
    font-size: 14px; font-weight: 600; color: var(--text-heading);
    display: flex; align-items: center; gap: 6px;
}
.country-info .v .ch {
    font-size: 11px; font-weight: 600;
}
.country-info .v .ch.up { color: var(--success); }
.country-info .v .ch.down { color: var(--danger); }
.country-info .n { font-size: 12px; color: var(--text-muted); }
.country-stat { text-align: right; }
.country-stat .num { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.country-stat .sub { font-size: 12px; color: var(--text-muted); }

/* Deposit / Withdraw lists */
.dep-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0;
}
.dep-row + .dep-row { border-top: 1px solid var(--divider); }
.dep-logo {
    width: 38px; height: 38px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    font-weight: 700;
}
.dep-logo.s2 { background: var(--success-soft); color: var(--success); }
.dep-logo.s3 { background: var(--warning-soft); color: var(--warning); }
.dep-logo.s4 { background: var(--info-soft); color: var(--info); }
.dep-logo.s5 { background: var(--danger-soft); color: var(--danger); }
.dep-info { flex: 1; }
.dep-info .t { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.dep-info .s { font-size: 12px; color: var(--text-muted); }
.dep-amt { font-size: 14px; font-weight: 600; }
.dep-amt.plus { color: var(--success); }
.dep-amt.minus { color: var(--danger); }
.view-all {
    font-size: 13px; color: var(--primary);
    font-weight: 500; text-decoration: none;
}
.view-all:hover { text-decoration: underline; }

/* ============================================
   TABLES (generic Materio table)
   ============================================ */
.table-materio {
    width: 100%;
    border-collapse: collapse;
}
.table-materio thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 14px 22px;
    background: #f9f9fb;
    border-bottom: 1px solid var(--divider);
}
.table-materio tbody td {
    padding: 14px 22px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--divider);
}
.table-materio tbody tr:hover { background: #fafafb; }
.table-materio tbody tr:last-child td { border-bottom: none; }

.badge-soft {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
}
.badge-soft.success { background: var(--success-soft); color: var(--success); }
.badge-soft.danger { background: var(--danger-soft); color: var(--danger); }
.badge-soft.warning { background: var(--warning-soft); color: var(--warning); }
.badge-soft.info { background: var(--info-soft); color: var(--info); }
.badge-soft.primary { background: var(--primary-soft); color: var(--primary); }

/* Alerts override (Bootstrap) */
.alert { border: none; border-radius: var(--radius-md); padding: 14px 18px; font-size: 13px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }

/* Buttons (generic) */
.btn-primary, .btn.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }

/* Responsive */
@media (max-width: 1199px) {
    .col-span-3 { grid-column: span 6; }
    .col-span-4 { grid-column: span 12; }
    .col-span-8 { grid-column: span 12; }
    .transactions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
    .col-span-6 { grid-column: span 12; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar { margin: 12px; }
    .page-content { padding: 16px 12px; }
    .menu-toggle { display: flex; }
    .search-box { display: none; }
    .user-info { display: none; }
    .transactions-grid { grid-template-columns: repeat(2, 1fr); }
}
