/* ==========================================================================
   Otaku BD Admin Panel - Responsive CSS
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1000;
    box-shadow: 1px 0 10px rgba(0,0,0,0.03);
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e84393;
    text-align: center;
    margin-bottom: 1.8rem;
    padding: 0 1rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.5rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #fff0f5;
    color: #e84393;
}

.sidebar nav a.active {
    border-left: 4px solid #e84393;
    font-weight: 600;
}

.sidebar nav a.logout-link {
    margin-top: auto;
    color: #ef4444;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.sidebar nav a.logout-link:hover {
    background: #fee2e2;
}

/* ── Main Content ─────────────────────────────────────────── */

.content {
    margin-left: 240px;
    flex: 1;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background: white;
    padding: 1.6rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    text-align: center;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #e84393;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.4rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #475569;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #e84393;
    box-shadow: 0 0 0 3px rgba(232,67,147,0.15);
}

button {
    padding: 0.85rem 1.6rem;
    background: #e84393;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #d63384;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 600px; /* forces scroll on very small screens */
}

th, td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f1f5f9;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem 1.4rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }

/* ── RESPONSIVE DESIGN ────────────────────────────────────── */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }

    .card-value { font-size: 1.8rem; }

    button {
        padding: 1rem;
        font-size: 1.05rem;
    }

    input, select {
        font-size: 1.05rem;
        padding: 0.95rem 1rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1rem 0.8rem;
    }

    .login-card, .card {
        padding: 1.5rem 1.2rem;
    }

    .logo {
        font-size: 1.8rem;
    }
}

/* ── Sidebar Toggle Button (mobile) ───────────────────────── */

.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    width: 48px;
    height: 48px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.4rem;
    color: #475569;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: flex;
    }
}

/* Overlay when sidebar open on mobile */
body.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 999;
}