/* ===================================================
   🌐 RESET & BASE STYLES (Mobile-First)
   =================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fb;
    font-size: 16px;
}

/* ===================================================
   🧱 LAYOUT SYSTEM
   =================================================== */

/* Full-height dashboard layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ===================================================
   🔤 TYPOGRAPHY & CONTAINERS
   =================================================== */

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================================================
   🔧 UTILITY CLASSES
   =================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.pt-2 { padding-top: 1rem; }
.pb-2 { padding-bottom: 1rem; }

/* ===================================================
   🔘 FORM STYLES
   =================================================== */

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

input:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

input::placeholder {
    color: #aaa;
}

/* ===================================================
   🔤 INPUTS WITH ICONS (Reusable)
   =================================================== */

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 12px;
    top: 70%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.input-icon input,
.input-icon select {
    padding-left: 40px;
}

/* ===================================================
   🎯 BUTTONS
   =================================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0069d9;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ===================================================
   📱 CARD LAYOUT (for forms, dashboards)
   =================================================== */

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 1rem;
    text-align: center;
}

/* ===================================================
   📊 ANALYTICS CARDS (Dashboard)
   =================================================== */

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-analytic {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    text-align: center;
    transition: transform 0.2s;
}

.card-analytic:hover {
    transform: translateY(-4px);
}

.card-analytic .icon {
    font-size: 2.2rem;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.card-analytic .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #007bff;
}

.card-analytic h3 {
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.5rem;
}

/* ===================================================
   🔁 LOADER (optional)
   =================================================== */

.loader {
    display: none;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================
   🛑 ERROR & SUCCESS MESSAGES
   =================================================== */

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===================================================
   🖼️ LOGO & HEADER
   =================================================== */

.logo {
    max-width: 180px;
    margin: 0 auto 1rem;
    display: block;
}

/* ===================================================
   🧭 SIDEBAR (Fixed Left)
   =================================================== */

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #007bff;
    border-bottom: 1px solid #eee;
}

.sidebar-brand img {
    width: 36px;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    padding: 0;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    color: #444;
    text-decoration: none;
    gap: 12px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #f1f5ff;
    color: #007bff;
    border-left: 3px solid #007bff;
}

.sidebar-section {
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid #eee;
    padding: 1rem;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d9534f;
    text-decoration: none;
    font-size: 0.95rem;
}

/* ===================================================
   🧭 HEADER (Top-Right)
   =================================================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: #fff;
    height: 70px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 900;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #555;
    cursor: pointer;
    display: none;
}

.header-search {
    flex: 1;
    max-width: 320px;
    position: relative;
    margin: 0 2rem;
}

.header-search input {
    width: 100%;
    padding: 0.6rem 0.8rem 0.6rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.header-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #555;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3545;
    color: white;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.user-menu img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===================================================
   📋 DROPDOWNS (Notifications & User)
   =================================================== */

.dropdown {
    position: absolute;
    top: 70px;
    right: 2rem;
    width: 300px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden;
    display: none;
    z-index: 1001;
}

.notify-dropdown {
    right: 2rem;
}

.user-dropdown {
    right: 2rem;
}

.dropdown h4 {
    padding: 1rem;
    margin: 0;
    border-bottom: 1px solid #eee;
    color: #333;
}

.dropdown ul {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown li {
    display: flex;
    gap: 12px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
}

.dropdown li:hover {
    background: #f8f9ff;
}

.dropdown li i {
    color: #007bff;
    font-size: 1.1rem;
    min-width: 24px;
}

.dropdown small {
    color: #888;
    font-size: 0.85rem;
}

.dropdown a {
    display: block;
    padding: 0.85rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
}

.dropdown a:hover {
    background: #f1f5ff;
}

.dropdown hr {
    margin: 0;
    border: 1px solid #eee;
}

/* ===================================================
   📱 TABLES (Reusable)
   =================================================== */

.table-responsive {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: #f1f3f5;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #444;
    font-size: 0.95rem;
}

tbody td {
    padding: 1rem;
    border-top: 1px solid #eee;
}

.status {
    padding: 0.3rem 0.6rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.status-success { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-failed  { background: #f8d7da; color: #721c24; }

/* ===================================================
   📱 MOBILE-FIRST → TABLET → DESKTOP (Responsive)
   =================================================== */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .container {
        width: 85%;
        padding: 30px;
    }

    .form-row {
        display: flex;
        gap: 1rem;
    }

    .form-col {
        flex: 1;
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }

    body {
        font-size: 17px;
    }
}

/* Mobile: Hamburger Menu */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 0 1rem;
    }

    .header-search {
        margin: 0 1rem;
        max-width: 200px;
    }
}