/**
 * HydroVerde - Dashboard Admin CSS
 * Responsive Design with Sidebar Navigation
 * Theme: Blue-Gray (#2c3e50) with Green Accent (#3fb893)
 */

:root {
    --primary-color: #2c3e50;
    --primary-light: #34495e;
    --primary-very-light: #e8f5f1;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e9ecef;
    --bg-light: #f0f2f5;
    --bg: #f8f9fa;
    --accent: #3fb893;
    --accent-light: #5ecfac;
    --accent-lighter: #e8f5f1;
    --white: #ffffff;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #3fb893;
    --sidebar-width: 280px;
    --sidebar-width-mobile: 0;
    --header-height: 70px;
}

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

html, body {
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout Structure */
.dashboard-container {
    display: flex;
    height: 100vh;
    flex-direction: row;
}

/* Header - Top Navigation */
.dashboard-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent) 100%);
    border-bottom: 3px solid var(--accent);
    padding: 0 20px 0 calc(var(--sidebar-width) + 20px);
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.2);
}

.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
}

.dashboard-logo img {
    height: 50px;
    width: auto;
}

.dashboard-logo-text h1 {
    font-size: 22px;
    color: var(--white);
    margin: 0;
    font-weight: 700;
}

.dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.user-badge strong {
    color: var(--white);
    font-weight: 600;
}

.user-badge .role {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    background: var(--danger);
    color: white;
    margin-left: 8px;
}

.user-badge .role.owner {
    background: var(--warning);
    color: var(--text-dark);
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f5fbf9 100%);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.show {
    display: block;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--white);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.sidebar-logo img {
    height: 40px;
    width: auto;
}

.sidebar-logo-text h2 {
    font-size: 18px;
    margin: 0;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 15px 20px 8px;
    margin-top: 10px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 14px;
}

.sidebar-nav-link:hover {
    background: var(--accent-lighter);
    color: var(--accent);
    border-left-color: var(--accent);
}

.sidebar-nav-link.active {
    background: var(--accent-lighter);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 700;
}

.sidebar-nav-link i,
.sidebar-nav-link .icon {
    font-size: 18px;
    min-width: 20px;
}

.sidebar-nav-link.logout {
    color: var(--danger);
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.sidebar-nav-link.logout:hover {
    background: #fadbd8;
}

/* Main Content Area */
.main-content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
}

.page-content {
    padding: 30px;
    max-width: 100%;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin: 0;
}

.page-header-description {
    color: var(--text-light);
    margin-top: 5px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #2c3e50 0%, #3fb893 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(63, 184, 147, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a252f 0%, #2d9873 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 184, 147, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--accent);
    border: 2px solid var(--accent);
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--accent-lighter);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e55555;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 15px;
    font-size: 13px;
}

/* Cards & Containers */
.card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--white) 0%, var(--accent-lighter) 100%);
    border-left: 4px solid var(--accent);
}

.card-header h2 {
    font-size: 18px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table thead {
    background: linear-gradient(135deg, var(--accent-lighter) 0%, #f0f9f7 100%);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent);
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--bg-light);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions a,
.table-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.table-actions .btn-view {
    background: var(--primary-light);
    color: white;
}

.table-actions .btn-edit {
    background: var(--primary-color);
    color: white;
}

.table-actions .btn-delete {
    background: var(--danger);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--accent-lighter);
    box-shadow: 0 0 0 3px rgba(63, 184, 147, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-success {
    background: var(--accent-lighter);
    color: var(--accent);
    font-weight: 700;
}

.badge-warning {
    background: #fce4b6;
    color: #854d0e;
}

.badge-danger {
    background: #fadbd8;
    color: #7a1f1a;
}

.badge-info {
    background: #d6e7f5;
    color: #1e3a5f;
}

.badge-draft {
    background: var(--border-color);
    color: var(--text-dark);
}

/* Modal/Dialog */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid var(--accent);
    box-shadow: 0 2px 8px rgba(63, 184, 147, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(63, 184, 147, 0.15);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin: 10px 0;
}

.stat-card .subtitle {
    font-size: 12px;
    color: var(--text-light);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--accent-lighter);
    border-left: 4px solid var(--accent);
    color: var(--accent);
    font-weight: 500;
}

.alert-warning {
    background: #fce4b6;
    border-left: 4px solid var(--warning);
    color: #854d0e;
}

.alert-danger {
    background: #fadbd8;
    border-left: 4px solid var(--danger);
    color: #7a1f1a;
}

.alert-info {
    background: #d6e7f5;
    border-left: 4px solid #2980b9;
    color: #1e3a5f;
}

.alert-icon {
    font-size: 20px;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    border-color: var(--accent);
}

/* Responsive Design - Tablet (1024px and below) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .page-content {
        padding: 25px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-header h2 {
        font-size: 16px;
    }
}

/* Medium Tablets (768px and below) */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --header-height: 65px;
    }

    .menu-toggle {
        display: block;
        padding: 8px 12px;
        line-height: 1;
        font-size: 28px;
        margin-right: 10px;
        transition: all 0.3s ease;
    }

    .menu-toggle:active {
        transform: scale(0.9);
    }

    .dashboard-header {
        padding-left: 20px;
        height: 65px;
    }

    .dashboard-logo-text h1 {
        font-size: 20px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        transition: transform 0.3s ease;
        z-index: 1000 !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar-overlay {
        display: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .main-content-wrapper {
        margin-left: 0;
        margin-top: 0;
    }

    .page-content {
        padding: 20px;
        margin-top: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .page-header-description {
        margin-top: 0;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 12px 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 25px;
    }

    .stat-card {
        padding: 18px;
        border-left-width: 4px;
    }

    .stat-card .value {
        font-size: 28px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        border-radius: 6px;
        margin-bottom: 20px;
    }

    .card-header {
        padding: 16px;
        border-radius: 6px 6px 0 0;
    }

    .card-header h2 {
        font-size: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .card-footer {
        padding: 12px 16px;
    }

    /* Responsive Tables */
    .table {
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 12px;
    }

    .table-actions {
        flex-direction: column;
        gap: 6px;
    }

    .table-actions a,
    .table-actions button {
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    .dashboard-header-right {
        gap: 8px;
        flex-wrap: wrap;
    }

    .user-badge {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 4px;
    }

    .user-badge .role {
        margin-left: 5px;
        padding: 3px 6px;
        font-size: 9px;
    }

    .modal-content {
        width: 90%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
        padding: 12px;
    }

    .btn {
        min-height: 44px;
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 18px;
    }
}

/* Small Tablets & Large Phones (600px and below) */
@media (max-width: 600px) {
    :root {
        --header-height: 60px;
    }

    .page-content {
        padding: 16px;
    }

    .page-header {
        gap: 12px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-header-description {
        font-size: 13px;
    }

    .page-actions {
        gap: 8px;
    }

    .page-actions .btn {
        font-size: 13px;
        padding: 10px 12px;
        min-height: 40px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        border-left-width: 3px;
    }

    .stat-card h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .stat-card .value {
        font-size: 24px;
        margin: 8px 0;
    }

    .stat-card .subtitle {
        font-size: 11px;
    }

    .card {
        margin-bottom: 18px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .card-header {
        padding: 14px;
    }

    .card-header h2 {
        font-size: 15px;
    }

    .card-body {
        padding: 14px;
    }

    .card-footer {
        padding: 11px 14px;
        flex-direction: column;
        gap: 8px;
    }

    .card-footer .btn {
        min-height: 40px;
        font-size: 13px;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 10px;
    }

    .table th {
        font-size: 11px;
    }

    .badge {
        font-size: 11px;
        padding: 5px 10px;
    }

    .btn {
        font-size: 13px;
        padding: 9px 14px;
        min-height: 40px;
        border-radius: 4px;
    }

    .btn-small {
        min-height: 36px;
        padding: 7px 12px;
        font-size: 12px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
        padding: 11px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .alert {
        padding: 12px 16px;
        font-size: 13px;
        gap: 10px;
    }

    .alert-icon {
        font-size: 18px;
        flex-shrink: 0;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 14px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-close {
        font-size: 22px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-footer {
        padding: 12px 14px;
        gap: 8px;
    }

    .sidebar {
        width: 260px;
    }

    .sidebar-header {
        padding: 16px;
    }

    .sidebar-nav-link {
        padding: 11px 14px;
        font-size: 13px;
    }

    .sidebar-section-title {
        font-size: 11px;
        padding: 12px 14px 6px;
    }
}

/* Phones (480px and below) */
@media (max-width: 480px) {
    :root {
        --header-height: 56px;
    }

    .menu-toggle {
        font-size: 24px;
        padding: 6px 10px;
        margin-right: 8px;
    }

    .dashboard-header {
        padding: 0 12px;
        height: 56px;
        gap: 8px;
    }

    .dashboard-header-left {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .dashboard-logo {
        min-width: 0;
    }

    .dashboard-logo img {
        height: 40px;
    }

    .dashboard-logo-text {
        display: none;
    }

    .dashboard-logo-text h1 {
        font-size: 16px;
    }

    .dashboard-header-right {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .user-badge {
        padding: 4px 8px;
        font-size: 10px;
        border-radius: 3px;
    }

    .user-badge strong {
        display: none;
    }

    .user-badge .role {
        margin-left: 4px;
        padding: 2px 5px;
        font-size: 8px;
    }

    .page-content {
        padding: 12px;
    }

    .page-header {
        gap: 10px;
    }

    .page-header h1 {
        font-size: 20px;
        margin-bottom: 0;
    }

    .page-header-description {
        font-size: 12px;
        margin-top: 2px;
    }

    .page-actions {
        width: 100%;
        gap: 6px;
    }

    .page-actions .btn {
        font-size: 12px;
        padding: 8px 10px;
        min-height: 38px;
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 14px;
        border-left-width: 3px;
        border-radius: 5px;
    }

    .stat-card h3 {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .stat-card .value {
        font-size: 22px;
        margin: 6px 0;
    }

    .stat-card .subtitle {
        font-size: 10px;
    }

    .card {
        border-radius: 5px;
        margin-bottom: 16px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
        border: 1px solid var(--border-color);
    }

    .card-header {
        padding: 12px;
    }

    .card-header h2 {
        font-size: 14px;
        font-weight: 700;
    }

    .card-body {
        padding: 12px;
    }

    .card-footer {
        padding: 10px 12px;
        flex-direction: column;
    }

    .card-footer .btn {
        width: 100%;
        font-size: 12px;
        min-height: 38px;
        padding: 8px 12px;
    }

    /* Responsive Table - Stack on mobile */
    .table {
        font-size: 11px;
    }

    .table th {
        font-size: 10px;
    }

    .table td {
        padding: 8px 6px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
    }

    .table-actions {
        gap: 4px;
    }

    .table-actions a,
    .table-actions button {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 34px;
        border-radius: 3px;
    }

    .badge {
        font-size: 10px;
        padding: 4px 8px;
        border-radius: 3px;
    }

    .btn {
        font-size: 12px;
        padding: 8px 12px;
        min-height: 38px;
        border-radius: 4px;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 34px;
    }

    .form-label {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 5px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
        padding: 10px;
        border-radius: 4px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-row {
        gap: 15px;
    }

    .alert {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
        border-radius: 4px;
    }

    .alert-icon {
        font-size: 16px;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 98%;
        max-height: 95vh;
        border-radius: 6px;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-header .modal-close {
        font-size: 20px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-footer {
        padding: 10px 12px;
        gap: 6px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        padding: 10px;
    }

    .sidebar {
        width: 240px;
    }

    .sidebar-header {
        padding: 14px;
    }

    .sidebar-nav-link {
        padding: 10px 12px;
        font-size: 12px;
        gap: 10px;
    }

    .sidebar-section-title {
        font-size: 10px;
        padding: 10px 12px 5px;
    }

    .pagination {
        gap: 3px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Extra Small Phones (360px and below) */
@media (max-width: 380px) {
    .page-header h1 {
        font-size: 18px;
    }

    .stat-card .value {
        font-size: 20px;
    }

    .card-header h2 {
        font-size: 13px;
    }

    .table {
        font-size: 10px;
    }

    .table th,
    .table td {
        padding: 6px 4px;
    }

    .btn {
        font-size: 11px;
        padding: 7px 10px;
    }

    .modal-content {
        max-height: 98vh;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .table-actions a,
    .table-actions button,
    .sidebar-nav-link,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    .sidebar-nav-link {
        padding: 12px 14px;
    }

    .btn {
        padding: 11px 16px;
    }

    button:active,
    a:active {
        opacity: 0.8;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.opacity-50 {
    opacity: 0.5;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: #b8c4d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8a96a6;
}

/* Print Styles */
@media print {
    .sidebar,
    .dashboard-header,
    .page-actions {
        display: none;
    }

    .main-content-wrapper {
        margin: 0;
    }

    .card {
        page-break-inside: avoid;
    }
}
