/* Taka Kori — Custom Styles */

:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #4338CA;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F8FAFC;
    color: #1E293B;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #fff;
    border-right: 1px solid #E2E8F0;
    position: fixed;
    top: 0; left: 0;
    z-index: 40;
    transition: transform .25s ease;
}
.sidebar.hidden-mobile { transform: translateX(-100%); }
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 35;
    display: none;
}
.sidebar-overlay.active { display: block; }

@media (min-width: 1024px) {
    .sidebar { transform: translateX(0) !important; }
    .sidebar-overlay { display: none !important; }
}

/* Nav link */
.nav-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 1rem;
    border-radius: .5rem;
    color: #64748B;
    font-size: .875rem;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
}
.nav-link:hover { background: #F1F5F9; color: #1E293B; }
.nav-link.active { background: #EEF2FF; color: var(--primary); }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Main content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}
@media (max-width: 1023px) {
    .main-content { margin-left: 0; }
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: .75rem;
    padding: 1.5rem;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: .75rem;
    padding: 1.25rem;
    display: flex; align-items: flex-start; gap: 1rem;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: .625rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    border: none; cursor: pointer;
    transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #F1F5F9; color: #475569; }
.btn-secondary:hover { background: #E2E8F0; }
.btn-danger { background: #FEF2F2; color: var(--danger); }
.btn-danger:hover { background: #FEE2E2; }
.btn-success { background: #ECFDF5; color: var(--success); }
.btn-success:hover { background: #D1FAE5; }
.btn-sm { padding: .4rem .75rem; font-size: .8125rem; }
.btn svg { width: 16px; height: 16px; }

/* Form inputs */
.form-input {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid #CBD5E1;
    border-radius: .5rem;
    font-size: .875rem;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: #1E293B;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-label {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: .35rem;
}
select.form-input { appearance: auto; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: .75rem 1rem;
    font-size: .75rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: .025em;
    border-bottom: 1px solid #E2E8F0;
    white-space: nowrap;
}
.data-table td {
    padding: .75rem 1rem;
    font-size: .875rem;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
}
.data-table tr:hover td { background: #FAFBFD; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: #fff;
    border-radius: .75rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Badge */
.badge {
    display: inline-flex;
    padding: .2rem .6rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 500;
}
.badge-green  { background: #ECFDF5; color: #059669; }
.badge-red    { background: #FEF2F2; color: #DC2626; }
.badge-yellow { background: #FFFBEB; color: #D97706; }
.badge-blue   { background: #EFF6FF; color: #2563EB; }
.badge-gray   { background: #F1F5F9; color: #64748B; }

/* Toast */
.toast-container {
    position: fixed; top: 1rem; right: 1rem;
    z-index: 100;
    display: flex; flex-direction: column; gap: .5rem;
}
.toast {
    padding: .75rem 1.25rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    color: #fff;
    animation: slideIn .25s ease;
    min-width: 250px;
}
.toast-success { background: #059669; }
.toast-error   { background: #DC2626; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94A3B8;
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto .75rem; opacity: .5; }

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: #F8FAFC;
    padding: 1rem;
}
.auth-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: .75rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

/* Chat */
.chat-messages {
    height: 420px;
    overflow-y: auto;
    padding: 1rem;
    display: flex; flex-direction: column; gap: .75rem;
}
.chat-bubble {
    max-width: 80%;
    padding: .75rem 1rem;
    border-radius: .75rem;
    font-size: .875rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.chat-user {
    background: #EEF2FF;
    color: #3730A3;
    align-self: flex-end;
    border-bottom-right-radius: .25rem;
}
.chat-bot {
    background: #F1F5F9;
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: .25rem;
}

/* Responsive table wrapper */
.table-wrap { overflow-x: auto; }

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0F172A;
}
