/* ============================================================
   M.A.T.A SYSTEM v2 - DESIGN SYSTEM
   Dark mode (default) + Light mode switchable theme
   Sidebar-based professional admin/member layout
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------------------------------------------------------
   DESIGN TOKENS
   --------------------------------------------------------- */
:root,
[data-theme="dark"] {
    --bg-app:        #0D1117;
    --bg-sidebar:    #10141F;
    --bg-card:       #161B29;
    --bg-card-hover: #1B2233;
    --bg-input:      #10141F;
    --bg-subtle:     #1C2333;
    --bg-table-head: #1B2233;

    --sidebar-text:          #AAB2C5;
    --sidebar-text-strong:   #F1F3F9;
    --sidebar-muted:         #6B7387;
    --sidebar-dimmed:        #4B5268;
    --sidebar-border:        rgba(255,255,255,0.06);
    --sidebar-hover-bg:      rgba(255,255,255,0.045);
    --sidebar-hover-text:    #E4E7EE;
    --sidebar-badge-bg:      rgba(255,255,255,0.08);
    --sidebar-badge-text:    #C7CCDA;
    --sidebar-avatar-border: rgba(255,255,255,0.1);

    --border-color:  rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.14);

    --text-primary:   #EDEFF5;
    --text-secondary: #98A2B8;
    --text-muted:     #626B82;
    --text-on-accent: #16130A;

    --accent:        #D6A84C;
    --accent-hover:  #E4B85E;
    --accent-soft:   rgba(214,168,76,0.14);
    --accent-2:      #4F7CFF;
    --accent-2-soft: rgba(79,124,255,0.14);

    --success:      #2FBF71;
    --success-soft: rgba(47,191,113,0.14);
    --warning:      #E8A93B;
    --warning-soft: rgba(232,169,59,0.14);
    --danger:       #EF5A5A;
    --danger-soft:  rgba(239,90,90,0.14);
    --info:         #4F7CFF;
    --info-soft:    rgba(79,124,255,0.14);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.24);
    --shadow-md: 0 8px 28px rgba(0,0,0,0.32);
    --shadow-lg: 0 20px 48px rgba(0,0,0,0.42);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --sidebar-w: 264px;
    --topbar-h: 72px;
    --transition: all 0.18s cubic-bezier(0.4,0,0.2,1);

    color-scheme: dark;
}

[data-theme="light"] {
    --bg-app:        #F4F1EA;
    --bg-sidebar:    #FFFFFF;
    --bg-card:       #FFFFFF;
    --bg-card-hover: #FBFAF6;
    --bg-input:      #FFFFFF;
    --bg-subtle:     #F0EDE4;
    --bg-table-head: #10141F;

    --sidebar-text:          #5B6478;
    --sidebar-text-strong:   #1B2130;
    --sidebar-muted:         #8A93A6;
    --sidebar-dimmed:        #A2A9BC;
    --sidebar-border:        rgba(16,20,31,0.08);
    --sidebar-hover-bg:      rgba(16,20,31,0.045);
    --sidebar-hover-text:    #1B2130;
    --sidebar-badge-bg:      rgba(16,20,31,0.06);
    --sidebar-badge-text:    #5B6478;
    --sidebar-avatar-border: rgba(16,20,31,0.10);

    --border-color:  rgba(16,20,31,0.08);
    --border-strong: rgba(16,20,31,0.16);

    --text-primary:   #1B2130;
    --text-secondary: #5B6478;
    --text-muted:     #8A93A6;
    --text-on-accent: #16130A;

    --accent:        #C7963A;
    --accent-hover:  #B4842C;
    --accent-soft:   rgba(199,150,58,0.12);
    --accent-2:      #3B5FDB;
    --accent-2-soft: rgba(59,95,219,0.10);

    --success:      #1D9A57;
    --success-soft: rgba(29,154,87,0.10);
    --warning:      #C6841E;
    --warning-soft: rgba(198,132,30,0.10);
    --danger:       #D9433F;
    --danger-soft:  rgba(217,67,63,0.10);
    --info:         #3B5FDB;
    --info-soft:    rgba(59,95,219,0.10);

    --shadow-sm: 0 2px 8px rgba(16,20,31,0.06);
    --shadow-md: 0 8px 28px rgba(16,20,31,0.08);
    --shadow-lg: 0 20px 48px rgba(16,20,31,0.14);

    color-scheme: light;
}

/* ---------------------------------------------------------
   BASE
   --------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, .brand-font {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration: none; }

.text-gradient {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.text-muted-mata { color: var(--text-muted) !important; }
.text-secondary-mata { color: var(--text-secondary) !important; }

/* ---------------------------------------------------------
   AUTH PAGES (login / register) — no sidebar
   --------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    position: relative;
}

.auth-bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}

.auth-glow {
    position: fixed; width: 560px; height: 560px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.10; filter: blur(40px); z-index: 0; pointer-events: none;
    top: -180px; right: -160px;
}
.auth-glow--2 {
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
    top: auto; right: auto; bottom: -200px; left: -160px;
}

.auth-card {
    position: relative; z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
}
.auth-card--sm { max-width: 460px; }
.auth-card--lg { max-width: 860px; }

.auth-brand { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.75rem; }
.auth-brand .logo-badge {
    width: 44px; height: 44px; border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), #B4842C);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.05rem;
    color: var(--text-on-accent); letter-spacing: -0.02em;
    box-shadow: var(--shadow-sm);
}
.auth-brand .brand-text { line-height: 1.15; }
.auth-brand .brand-text strong { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; }
.auth-brand .brand-text span { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }

.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.3rem; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 1.75rem; }

.theme-toggle-fixed { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 20; }

/* ---------------------------------------------------------
   FORM ELEMENTS
   --------------------------------------------------------- */
.field { margin-bottom: 1.1rem; position: relative; }
.field label {
    display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.field label .req { color: var(--danger); }

.field-input-wrap { position: relative; }
.field-icon {
    position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.9rem; pointer-events: none;
}
.form-control, .form-select {
    width: 100%; background: var(--bg-input); border: 1px solid var(--border-color);
    color: var(--text-primary); border-radius: var(--radius-sm);
    padding: 0.72rem 0.9rem; font-size: 0.92rem; transition: var(--transition);
    height: 46px;
}
.field-input-wrap .form-control,
.field-input-wrap .form-select { padding-left: 2.5rem; }
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-select { appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2398A2B8' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center;
}
textarea.form-control { height: auto; padding-top: 0.72rem; }
.field-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }
.field-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.35rem; display: none; }
.is-invalid ~ .field-error { display: block; }

.toggle-password {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem;
}
.toggle-password:hover { color: var(--text-secondary); }

.form-check-mata { display: flex; align-items: flex-start; gap: 0.6rem; }
.form-check-mata input[type="checkbox"] {
    width: 18px; height: 18px; margin-top: 0.15rem; accent-color: var(--accent); flex-shrink: 0; cursor: pointer;
}
.form-check-mata label { font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }

/* ---------------------------------------------------------
   BUTTONS
   --------------------------------------------------------- */
.btn-mata {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border: none; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem;
    padding: 0.75rem 1.4rem; cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-mata-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--text-on-accent); box-shadow: 0 6px 20px var(--accent-soft);
}
.btn-mata-primary:hover { filter: brightness(1.06); transform: translateY(-1px); color: var(--text-on-accent); }
.btn-mata-primary:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.btn-mata-outline {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text-primary);
}
.btn-mata-outline:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-mata-ghost { background: transparent; color: var(--text-secondary); }
.btn-mata-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-mata-danger { background: var(--danger-soft); color: var(--danger); }
.btn-mata-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm-mata { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
.btn-icon-only { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ---------------------------------------------------------
   THEME TOGGLE SWITCH
   --------------------------------------------------------- */
.theme-switch {
    display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 999px; padding: 0.4rem 0.7rem; font-size: 0.78rem; color: var(--text-secondary);
    user-select: none;
}
.theme-switch i { font-size: 0.85rem; }
.theme-switch .switch-track {
    width: 34px; height: 18px; border-radius: 999px; background: var(--bg-subtle);
    position: relative; border: 1px solid var(--border-color);
}
.theme-switch .switch-thumb {
    position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); transition: var(--transition);
}
[data-theme="light"] .theme-switch .switch-thumb { left: calc(100% - 15px); }

/* ---------------------------------------------------------
   APP SHELL (sidebar + topbar) — logged-in pages
   --------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); background: var(--bg-sidebar); flex-shrink: 0;
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 40; transition: transform 0.25s ease, background 0.25s ease;
    border-right: 1px solid var(--sidebar-border);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 0.7rem; padding: 1.4rem 1.4rem 1.2rem;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand .logo-badge {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #B4842C);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; color: var(--text-on-accent); font-size: 0.95rem;
    flex-shrink: 0;
}
.sidebar-brand .brand-text strong { display: block; color: var(--sidebar-text-strong); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em; }
.sidebar-brand .brand-text span { font-size: 0.62rem; color: var(--sidebar-muted); letter-spacing: 0.09em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0.9rem; }
.sidebar-section-label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--sidebar-dimmed); padding: 1rem 0.6rem 0.5rem;
}
.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm); color: var(--sidebar-text); font-size: 0.88rem; font-weight: 500;
    margin-bottom: 0.15rem; transition: var(--transition); position: relative;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 0.92rem; color: var(--sidebar-muted); transition: var(--transition); }
.sidebar-link:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-text); }
.sidebar-link:hover i { color: var(--sidebar-text); }
.sidebar-link.active {
    background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.sidebar-link.active i { color: var(--accent); }
.sidebar-badge {
    margin-left: auto; background: var(--sidebar-badge-bg); color: var(--sidebar-badge-text);
    font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px;
}
.sidebar-link.active .sidebar-badge { background: var(--accent); color: var(--text-on-accent); }

.sidebar-foot { padding: 1rem 1.4rem 1.4rem; border-top: 1px solid var(--sidebar-border); }
.sidebar-user { display: flex; align-items: center; gap: 0.65rem; }
.sidebar-user img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--sidebar-avatar-border); flex-shrink: 0; }
.sidebar-user .u-name { font-size: 0.83rem; font-weight: 600; color: var(--sidebar-hover-text); line-height: 1.25; }
.sidebar-user .u-company { font-size: 0.71rem; color: var(--sidebar-muted); line-height: 1.3; }
.sidebar-user .u-role { font-size: 0.7rem; color: var(--sidebar-muted); }
.sidebar-user .u-badges { display: flex; gap: 0.3rem; margin-top: 0.35rem; flex-wrap: wrap; }
.sidebar-user .u-badges .badge-mata { font-size: 0.62rem; padding: 0.18rem 0.45rem; }

.sidebar-mobile-toggle {
    display: none; position: fixed; top: 1rem; left: 1rem; z-index: 60;
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary);
    align-items: center; justify-content: center; box-shadow: var(--shadow-md); cursor: pointer;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39; }

.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.app-topbar {
    height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; border-bottom: 1px solid var(--border-color); background: var(--bg-app);
    position: sticky; top: 0; z-index: 30; gap: 1rem; flex-wrap: wrap;
}
.app-topbar h1 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.app-topbar .page-subtitle { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.1rem; }
.topbar-actions { display: flex; align-items: center; gap: 0.7rem; }

.app-content { padding: 1.75rem 2rem 3rem; flex: 1; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .app-main { margin-left: 0; }
    .sidebar-mobile-toggle { display: flex; }
    .sidebar-overlay.show { display: block; }
    .app-topbar { padding: 0 1.25rem 0 4.5rem; }
    .app-content { padding: 1.25rem 1.25rem 2.5rem; }
}

/* ---------------------------------------------------------
   CARDS
   --------------------------------------------------------- */
.card-mata {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-mata-pad { padding: 1.5rem; }

/* ---------------------------------------------------------
   STAT CARDS
   --------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
@media (max-width: 991.98px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-top: 3px solid var(--accent);
    border-radius: var(--radius); padding: 1.25rem; position: relative;
}
.stat-card.stat-accent-2 { border-top-color: var(--accent-2); }
.stat-card.stat-success { border-top-color: var(--success); }
.stat-card.stat-warning { border-top-color: var(--warning); }
.stat-card.stat-danger { border-top-color: var(--danger); }

.stat-card .stat-label {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 0.6rem; display: flex; justify-content: space-between; align-items: center;
}
.stat-card .stat-icon-wrap {
    width: 30px; height: 30px; border-radius: 8px; background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 0.85rem;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.1; }
.stat-card .stat-foot { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }

/* ---------------------------------------------------------
   TABS / PILLS
   --------------------------------------------------------- */
.pill-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.pill-tab {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem;
    border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.pill-tab:hover { color: var(--text-primary); }
.pill-tab.active { background: var(--text-primary); color: var(--bg-app); border-color: var(--text-primary); }
[data-theme="dark"] .pill-tab.active { background: #EDEFF5; color: #10141F; }
.pill-tab .count {
    background: rgba(255,255,255,0.15); font-size: 0.7rem; padding: 0.05rem 0.4rem; border-radius: 999px;
}
.pill-tab:not(.active) .count { background: var(--bg-subtle); }

/* ---------------------------------------------------------
   TABLE
   --------------------------------------------------------- */
.table-toolbar { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.table-toolbar .search-wrap { flex: 1; min-width: 220px; position: relative; }
.table-toolbar .search-wrap i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }
.table-toolbar .search-wrap input { padding-left: 2.4rem; }
.table-toolbar select { max-width: 180px; }

.table-mata-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-color); }
table.table-mata2 { width: 100%; border-collapse: collapse; font-size: 0.87rem; background: var(--bg-card); }
table.table-mata2 thead { background: var(--bg-table-head); }
table.table-mata2 thead th {
    text-align: left; padding: 0.85rem 1rem; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase; color: #AAB2C5; white-space: nowrap;
}
[data-theme="light"] table.table-mata2 thead th { color: #C7CCDA; }
table.table-mata2 tbody td { padding: 0.9rem 1rem; border-top: 1px solid var(--border-color); vertical-align: middle; }
table.table-mata2 tbody tr:hover { background: var(--bg-card-hover); }

.table-avatar { display: flex; align-items: center; gap: 0.65rem; }
.table-avatar img, .avatar-fallback {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.avatar-fallback {
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.78rem;
    color: var(--text-on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.table-avatar .name { font-weight: 600; color: var(--text-primary); font-size: 0.87rem; }
.table-avatar .sub { font-size: 0.75rem; color: var(--text-muted); }

/* ---------------------------------------------------------
   BADGES
   --------------------------------------------------------- */
.badge-mata {
    display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700;
    padding: 0.28rem 0.65rem; border-radius: 999px; white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-info    { background: var(--info-soft); color: var(--info); }
.badge-accent  { background: var(--accent-soft); color: var(--accent); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }

/* ---------------------------------------------------------
   ALERTS / TOASTS
   --------------------------------------------------------- */
.alert-mata {
    display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 0.85rem; position: relative;
    border: 1px solid transparent;
}
.alert-mata i { margin-top: 0.1rem; }
.alert-mata .alert-close {
    position: absolute; right: 0.7rem; top: 0.7rem; background: none; border: none;
    color: inherit; opacity: 0.6; cursor: pointer; font-size: 0.8rem;
}
.alert-mata .alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
.alert-danger  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }
.alert-info    { background: var(--info-soft); color: var(--info); border-color: var(--info-soft); }
.alert-mata ul { margin: 0.3rem 0 0 1.1rem; padding: 0; }

/* ---------------------------------------------------------
   CAPTCHA
   --------------------------------------------------------- */
.captcha-box-mata {
    display: flex; align-items: center; gap: 0.85rem; background: var(--bg-subtle);
    border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem; margin-bottom: 1.1rem;
}
.captcha-box-mata .cq {
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.05rem;
    color: var(--accent); letter-spacing: 1px; user-select: none;
}
.captcha-box-mata input { max-width: 100px; height: 40px; }

/* ---------------------------------------------------------
   MODAL (lightweight, no bootstrap JS dependency)
   --------------------------------------------------------- */
.modal-mata-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    z-index: 100; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal-mata-backdrop.show { display: flex; }
.modal-mata {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.modal-mata-header {
    display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-mata-header h5 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.modal-mata-body { padding: 1.5rem; }
.modal-mata-footer { padding: 1.1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 0.6rem; }
.modal-mata-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }

/* ---------------------------------------------------------
   PROFILE PHOTO
   --------------------------------------------------------- */
.photo-upload-wrap { position: relative; width: 128px; height: 128px; margin: 0 auto; }
.photo-upload-wrap img {
    width: 128px; height: 128px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--bg-card); box-shadow: var(--shadow-md);
}
.photo-upload-wrap .cam-btn {
    position: absolute; bottom: 2px; right: 2px; width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: var(--text-on-accent); border: 3px solid var(--bg-card);
    display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.8rem;
}

/* ---------------------------------------------------------
   PROFIL AHLI (profile.php) - reka bentuk profesional
   --------------------------------------------------------- */
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 991.98px) { .profile-layout { grid-template-columns: 1fr; } }

.profile-hero-card { text-align: center; }
.profile-avatar-wrap { width: 132px; height: 132px; }
.profile-avatar-wrap img { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg-card); box-shadow: var(--shadow-md); }
.profile-verified-badge {
    position: absolute; bottom: 2px; left: 2px; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem;
    border: 3px solid var(--bg-card); box-shadow: var(--shadow-md);
}
.profile-verified-badge.badge-verified-member { background: #16a34a; }       /* hijau - Ahli M.A.T.A */
.profile-verified-badge.badge-verified-professional { background: #2563eb; } /* biru - Ahli Profesional */

.profile-stat-row { display: flex; justify-content: space-around; margin-top: 1.25rem; padding: 1rem 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.profile-stat { text-align: center; flex: 1; }
.profile-stat .num { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.profile-stat .lbl { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.25rem; }

.profile-info-list { text-align: left; margin-top: 1rem; }
.profile-info-list .row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border-color); font-size: 0.83rem; }
.profile-info-list .row:last-child { border-bottom: none; }
.profile-info-list .row .lbl { color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.profile-info-list .row .lbl i { width: 16px; color: var(--text-muted); }
.profile-info-list .row .val { font-weight: 600; color: var(--text-primary); text-align: right; }

/* ---------------------------------------------------------
   MISC
   --------------------------------------------------------- */
.divider-text {
    display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted);
    font-size: 0.78rem; margin: 1.25rem 0;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state i { font-size: 2.2rem; margin-bottom: 0.85rem; opacity: 0.5; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.section-label-mata {
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 0.82rem;
    letter-spacing: 0.03em; text-transform: uppercase;
    color: var(--accent); margin: 2rem 0 1.1rem; padding: 0.65rem 1rem;
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--accent-soft); border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}
.section-label-mata i {
    width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--text-on-accent);
    display: flex; align-items: center; justify-content: center; font-size: 0.78rem; flex-shrink: 0;
}
.section-label-mata:first-child { margin-top: 0; }

.form-section-block {
    background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    padding: 1.25rem 1.25rem 0.25rem; margin-bottom: 0.5rem;
}
[data-theme="light"] .form-section-block .form-control,
[data-theme="light"] .form-section-block .form-select { background: #fff; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 575.98px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
@media (max-width: 767.98px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------
   PUBLIC NAVBAR (halaman awam - login, daftar, senarai acara)
   --------------------------------------------------------- */
.public-navbar {
    background: var(--bg-card); border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 50;
}
.public-navbar-inner {
    max-width: 1200px; margin: 0 auto; padding: 0.85rem 1.5rem;
    display: flex; align-items: center; gap: 1.5rem;
}
.public-navbar-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.public-navbar-brand img.logo-img { height: 30px; width: auto; display: block; }
.public-navbar-brand .brand-text strong { display: block; color: var(--text-primary); font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 0.92rem; }
.public-navbar-brand .brand-text span { font-size: 0.6rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.public-navbar-links { display: flex; gap: 1.5rem; flex: 1; }
.public-nav-link { color: var(--text-secondary); font-size: 0.82rem; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: 0.04em; }
.public-nav-link:hover, .public-nav-link.active { color: var(--accent); }
.public-navbar-actions { display: flex; align-items: center; gap: 0.6rem; }
.public-navbar-toggle {
    display: none; background: none; border: 1px solid var(--border-color); border-radius: 8px;
    width: 38px; height: 38px; color: var(--text-primary); cursor: pointer;
}
.public-navbar-mobile { display: none; flex-direction: column; gap: 0.75rem; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--border-color); }
.public-navbar-mobile.show { display: flex; }
@media (max-width: 860px) {
    .public-navbar-links, .public-navbar-actions { display: none; }
    .public-navbar-toggle { display: flex; align-items: center; justify-content: center; }
}

/* ---------------------------------------------------------
   EVENT CARDS (awam & ahli)
   --------------------------------------------------------- */
.event-hero-banner {
    width: 100%; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
}
.event-hero-banner img { width: 100%; display: block; }
.event-meta-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 1rem 0 1.5rem; }
.event-meta-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--text-secondary); }
.event-meta-item i { color: var(--accent); width: 16px; }
.event-content-body { font-size: 0.93rem; line-height: 1.75; color: var(--text-secondary); }
.event-content-body p { margin-bottom: 1rem; }

.event-list-table-wrap { overflow-x: auto; }
.event-price-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.event-price-table th {
    text-align: left; padding: 0.75rem 1rem; background: var(--bg-table-head); color: var(--sidebar-badge-text);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
[data-theme="light"] .event-price-table th { color: #FFFFFF; }
.event-price-table td { padding: 0.85rem 1rem; border-top: 1px solid var(--border-color); vertical-align: middle; }
.event-price-table tr:hover td { background: var(--bg-card-hover); }

.event-card-compact {
    display: flex; gap: 1rem; padding: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius);
    background: var(--bg-card); margin-bottom: 1rem; text-decoration: none; color: inherit; transition: var(--transition);
}
.event-card-compact:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.event-card-compact .thumb { width: 110px; height: 78px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-subtle); }
.event-card-compact .info h5 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; color: var(--text-primary); }
.event-card-compact .info .date { font-size: 0.78rem; color: var(--text-muted); }

.countdown-box { text-align: center; padding: 1.25rem; }
.countdown-box .num { font-size: 2.6rem; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--accent); line-height: 1; }
.countdown-box .lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

.side-info-card { margin-bottom: 1.25rem; }
.side-info-card .card-head {
    background: linear-gradient(135deg, var(--accent), #B4842C); color: var(--text-on-accent);
    padding: 0.75rem 1.1rem; border-radius: var(--radius) var(--radius) 0 0; font-weight: 700; font-size: 0.88rem;
}
.side-info-card .card-body-mata { padding: 1.1rem; }
.side-info-row { margin-bottom: 0.85rem; }
.side-info-row:last-child { margin-bottom: 0; }
.side-info-row .lbl { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.side-info-row .val { font-size: 0.88rem; color: var(--text-primary); font-weight: 600; }

.announcement-card { padding: 1.5rem; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-card); margin-bottom: 1rem; scroll-margin-top: 5.5rem; }
.app-content .announcement-card { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.announcement-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.announcement-card .date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.85rem; }
.announcement-card .body { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; white-space: pre-line; }

.category-box-link {
    display: block; padding: 1.75rem; border-radius: var(--radius); border: 1px solid var(--border-color);
    background: var(--bg-card); text-decoration: none; color: inherit; transition: var(--transition); height: 100%;
}
.category-box-link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.category-box-link .icon-wrap {
    width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1rem;
}
.category-box-link h5 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text-primary); }
.category-box-link p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

/* ---------------------------------------------------------
   SIDEBAR SECTION LABEL - highlight parent group vs sub-links
   --------------------------------------------------------- */
.sidebar-section-label {
    font-size: 0.66rem !important; font-weight: 800 !important; letter-spacing: 0.1em !important;
    text-transform: uppercase; color: var(--accent) !important; padding: 1.1rem 0.6rem 0.5rem !important;
    position: relative; display: flex; align-items: center; gap: 0.4rem;
}
.sidebar-section-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ---------------------------------------------------------
   IMAGE SLIDER (login page & events)
   --------------------------------------------------------- */
.mata-slider { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: rgba(255,255,255,0.08); }
.mata-slider .slide {
    display: none; width: 100%; aspect-ratio: 16/9; position: relative;
}
.mata-slider .slide.active { display: block; animation: sliderFade 0.6s ease; }
@keyframes sliderFade { from { opacity: 0; } to { opacity: 1; } }
.mata-slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mata-slider .slide .slide-caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1.1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    color: #fff; font-size: 0.85rem; font-weight: 700;
}
.mata-slider .slide .slide-caption span { display: block; font-size: 0.68rem; font-weight: 500; opacity: 0.85; margin-top: 0.2rem; }
.mata-slider .slide-dots { position: absolute; bottom: 0.6rem; right: 0.75rem; display: flex; gap: 0.35rem; z-index: 2; }
.mata-slider .slide-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: var(--transition); }
.mata-slider .slide-dots .dot.active { background: #fff; width: 16px; border-radius: 4px; }
.mata-slider-empty {
    display: flex; align-items: center; justify-content: center; aspect-ratio: 16/9;
    color: rgba(255,255,255,0.7); font-size: 0.9rem; background: rgba(255,255,255,0.06);
}
.slide-category-badge {
    position: absolute; top: 0.7rem; left: 0.7rem; background: rgba(16,20,31,0.75); backdrop-filter: blur(4px);
    color: #fff; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 0.3rem 0.65rem; border-radius: 999px; z-index: 2;
}
/* Slider Pengumuman - halaman ahli (announcements.php) */
.ann-slider .slide { aspect-ratio: 21/9; }
@media (max-width: 767.98px) { .ann-slider .slide { aspect-ratio: 16/9; } }
@media (max-width: 480px) { .ann-slider .slide { aspect-ratio: 4/3; } }

/* ---------------------------------------------------------
   EVENTS PUBLIC TABLE (redesign - Tajuk|Kaedah|Jenis Ahli|Yuran|Pendaftaran)
   --------------------------------------------------------- */
.events-table-card { border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; background: var(--bg-card); margin-bottom: 1.5rem; }
.events-table-head-row {
    display: grid; grid-template-columns: 2.2fr 1fr 1.3fr 0.9fr 1.3fr; gap: 0.5rem;
    background: var(--bg-table-head); padding: 0.8rem 1.1rem; font-size: 0.68rem; font-weight: 800;
    letter-spacing: 0.07em; text-transform: uppercase; color: #AAB2C5;
}
[data-theme="light"] .events-table-head-row { color: #FFFFFF; }
.event-row-group { border-top: 1px solid var(--border-color); }
.event-row-group .event-row-banner { display: flex; gap: 1rem; padding: 1.1rem; align-items: flex-start; }
.event-row-banner .thumb-lg { width: 130px; height: 88px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-subtle); }
.event-row-banner h5 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.event-row-banner .meta { font-size: 0.78rem; color: var(--text-muted); }
.event-ticket-row {
    display: grid; grid-template-columns: 2.2fr 1fr 1.3fr 0.9fr 1.3fr; gap: 0.5rem; align-items: center;
    padding: 0.7rem 1.1rem; font-size: 0.85rem; border-top: 1px dashed var(--border-color);
}
.event-ticket-row .reg-btns { display: flex; gap: 0.4rem; }
@media (max-width: 767.98px) {
    .events-table-head-row { display: none; }
    .event-ticket-row { grid-template-columns: 1fr; text-align: left; gap: 0.15rem; padding: 0.6rem 1.1rem; }
    .event-ticket-row > div::before { content: attr(data-label); display: block; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
}

/* ---------------------------------------------------------
   RECEIPT / INVOICE (printable)
   --------------------------------------------------------- */
.receipt-box { border: 1px solid var(--border-color); border-radius: var(--radius); padding: 2rem; background: var(--bg-card); }
.receipt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 2px solid var(--border-color); }
.receipt-header .r-logo { display: flex; align-items: center; gap: 0.6rem; }
.receipt-header .r-logo img { height: 40px; }
.receipt-title { text-align: right; }
.receipt-title h3 { font-size: 1.3rem; font-weight: 800; color: var(--accent); margin: 0; }
.receipt-title .inv-no { font-size: 0.85rem; color: var(--text-muted); }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 1.25rem 0; }
.receipt-table td { padding: 0.5rem 0; }
.receipt-table .total-row td { border-top: 2px solid var(--border-color); font-weight: 800; font-size: 1.05rem; padding-top: 0.75rem; color: var(--accent); }
@media print {
    .sidebar, .app-topbar, .no-print, .public-navbar { display: none !important; }
    .app-main { margin-left: 0 !important; }
    body { background: #fff !important; }
}

/* ---------------------------------------------------------
   PAYMENT MODE CARDS (checkout selection)
   --------------------------------------------------------- */
.payment-mode-option {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; border: 2px solid var(--border-color);
    border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 0.6rem; transition: var(--transition);
}
.payment-mode-option:hover { border-color: var(--accent); }
.payment-mode-option input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }
.payment-mode-option .pm-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; flex-shrink: 0; }
.payment-mode-option .pm-label { font-weight: 600; font-size: 0.9rem; }
.payment-mode-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.bank-account-card { border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 0.85rem 1rem; margin-bottom: 0.6rem; display: flex; justify-content: space-between; align-items: center; }
.bank-account-card .b-name { font-weight: 700; font-size: 0.9rem; }
.bank-account-card .b-acc { font-size: 0.85rem; color: var(--text-secondary); font-family: monospace; }

/* ---------------------------------------------------------
   SMOOTH AUTO-SCROLLING TICKER (Pengumuman / Kursus di dashboard)
   --------------------------------------------------------- */
.ticker-box { height: 240px; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%); }
.ticker-track { display: flex; flex-direction: column; }
.ticker-track.is-scrolling { animation-name: tickerScroll; animation-timing-function: linear; animation-iteration-count: infinite; }
.ticker-box:hover .ticker-track.is-scrolling { animation-play-state: paused; }
@keyframes tickerScroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.ticker-item {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.25rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--border-color); transition: var(--transition); min-width: 0;
}
.ticker-item:hover { color: var(--accent); }
.ticker-item .ticker-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.ticker-item .ticker-text { flex: 1 1 auto; min-width: 0; font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticker-item .ticker-date { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; margin-left: auto; }
@media (max-width: 575.98px) {
    .ticker-item .ticker-text { font-size: 0.8rem; }
    .ticker-item .ticker-date { font-size: 0.68rem; }
}
