/* =========================
   MOBILE-FIRST RESPONSIVE DESIGN
   J H Urban Weaves Admin Panel
   ========================= */

:root {
    --primary-color: #1a73e8;
    --secondary-color: #f57c00;
    --success-color: #0f9d58;
    --danger-color: #d33b27;
    --warning-color: #f9ab00;
    --info-color: #1a73e8;
    --light-bg: #f8f9fa;
    --dark-text: #202124;
    --border-color: #dadce0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 3px 6px rgba(0, 0, 0, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
}

/* Typography */
h1 { font-size: 24px; font-weight: 600; margin-bottom: 16px; }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
p { line-height: 1.5; margin-bottom: 8px; }

/* Layout */
body {
    display: flex;
    flex-direction: column;
}

.navbar {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: none;
}

.navbar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark-text);
}

.navbar-menu.active {
    display: block;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    box-shadow: var(--shadow-lg);
}

.navbar-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--dark-text);
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background-color: var(--light-bg);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Card */
.card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    margin-bottom: 16px;
}

.card-footer {
    text-align: right;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #e68900;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #0d7e47;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #a02417;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--dark-text);
}

.btn-outline:hover {
    background-color: var(--light-bg);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    margin-bottom: 12px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-right: 8px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    margin-bottom: 16px;
}

.table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-bg);
}

.table-responsive {
    overflow-x: auto;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #f1f8e9;
    color: #0f9d58;
    border-left-color: #0f9d58;
}

.alert-danger {
    background-color: #ffebee;
    color: #d33b27;
    border-left-color: #d33b27;
}

.alert-warning {
    background-color: #fff3e0;
    color: #f9ab00;
    border-left-color: #f9ab00;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1a73e8;
    border-left-color: #1a73e8;
}

/* Dashboard Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #5f6368;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: #e3f2fd;
    color: var(--primary-color);
}

.badge-success {
    background-color: #f1f8e9;
    color: var(--success-color);
}

.badge-danger {
    background-color: #ffebee;
    color: var(--danger-color);
}

.badge-warning {
    background-color: #fff3e0;
    color: var(--warning-color);
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #5f6368;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: #5f6368; }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .navbar-toggle {
        display: none;
    }

    .navbar-menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        background-color: transparent;
        border-bottom: none;
        padding: 0;
        box-shadow: none;
        gap: 8px;
    }

    .navbar-menu a {
        padding: 8px 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .navbar-menu a:hover,
    .navbar-menu a.active {
        border-bottom-color: var(--primary-color);
        border-left: none;
    }

    .main-content {
        padding: 24px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table {
        font-size: 14px;
    }

    .table th,
    .table td {
        padding: 14px;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }

    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 18px; }

    .card {
        padding: 20px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .navbar-toggle {
        display: none;
    }

    body {
        background-color: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
