/* Admin Panel Styles - Modern Design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);

    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

    --dark-glass-bg: rgba(0, 0, 0, 0.25);
    --dark-glass-border: rgba(255, 255, 255, 0.125);

    --sidebar-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: #2d3748;
    position: relative;
}

/* Container for the entire app */
.admin-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main layout wrapper */
.main-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 0px);
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Page Loading Animation */
@keyframes pageLoad {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-container {
    animation: pageLoad 0.6s ease-out;
}

/* Enhanced Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Improved Focus States */
.form-input:focus, .form-select:focus, .form-textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 10px 25px rgba(0, 0, 0, 0.1);
}

.link-button {
    color: #4c51bf;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

/* Better Mobile Touch Feedback */
@media (hover: none) {
    .btn:active {
        transform: scale(0.98);
    }

    .nav-link:active {
        transform: scale(0.98);
    }

    .glass-card:active {
        transform: scale(0.99);
    }
}

/* Sidebar Styling */
.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 256px;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 80px !important;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header h2 {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-header p {
    opacity: 0;
}

.sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1001;
    margin-left: 1rem;
    opacity: 0;
    animation: fadeInTooltip 0.2s ease forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}

/* Desktop: Completely hide sidebar when collapsed */
@media (min-width: 1025px) {
    .sidebar.collapsed {
        width: 0 !important;
        visibility: hidden;
        overflow: hidden;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.sidebar .sidebar-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 1.5rem;
    text-align: center;
}

.sidebar .sidebar-header h2 {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sidebar .sidebar-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
}

.mobile-sidebar-close {
    display: none;
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.mobile-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation Links */
.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.875rem 1.5rem;
    margin: 0.25rem 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    border-left: 4px solid rgba(255, 255, 255, 0.8);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Main Content */
.main-content {
    flex: 1;
    background: transparent;
    min-height: 100vh;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 256px;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

.main-header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.main-header p {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    opacity: 0.1;
    transform: translate(20px, -20px);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.stat-card .stat-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Form Styling */
.form-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Toast Notifications */
.toast {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    z-index: 1000;
}

.toast-success {
    border-left: 4px solid #48bb78;
}

.toast-error {
    border-left: 4px solid #f56565;
}

.toast-warning {
    border-left: 4px solid #ed8936;
}

.toast-info {
    border-left: 4px solid #4299e1;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design - Enhanced Mobile & Tablet Support */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .main-content {
        padding: 3rem;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .sidebar {
        width: 320px;
    }

    .main-content {
        margin-left: 320px;
    }
}

/* Desktop (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .sidebar {
        width: 280px;
    }

    .main-content {
        margin-left: 280px;
    }
}

/* Tablet Landscape (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .stat-card {
        padding: 1.75rem;
    }

    .main-header h1 {
        font-size: 2.25rem;
    }

    .nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Hide desktop toggle on tablet */
    #sidebarToggle {
        display: none !important;
    }

    .mobile-sidebar-close {
        display: inline-flex;
    }
}

/* Tablet Portrait (601px - 768px) */
@media (max-width: 768px) and (min-width: 601px) {
    .main-content {
        padding: 1rem;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-sidebar-close {
        display: inline-flex;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .stat-card .stat-icon {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .stat-card .stat-content {
        flex-grow: 1;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .main-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .main-header h1 {
        font-size: 1.875rem;
    }

    .main-header p {
        font-size: 1rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .nav-link i {
        font-size: 1rem;
    }

    .form-input, .form-select, .form-textarea {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Mobile Large (481px - 600px) */
@media (max-width: 600px) and (min-width: 481px) {
    .main-content {
        padding: 0.75rem;
        margin-left: 0;
    }

    .sidebar {
        width: 100%;
        height: 100vh;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-sidebar-close {
        display: inline-flex;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

    .stat-card .stat-icon {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .stat-card .stat-content {
        flex-grow: 1;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .main-header {
        padding: 1.25rem 0.75rem;
        margin-bottom: 1rem;
    }

    .main-header h1 {
        font-size: 1.75rem;
    }

    .main-header p {
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch target */
    }

    .nav-link {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        min-height: 48px; /* Touch target */
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input, .form-select, .form-textarea {
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 44px; /* Touch target */
    }

    .glass-card {
        margin-bottom: 1rem;
    }
}

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
        margin-left: 0;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-sidebar-close {
        display: inline-flex;
    }

    .sidebar .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .sidebar .sidebar-header h2 {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .stat-card {
        padding: 0.8rem;
        border-radius: 14px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .stat-card .stat-icon {
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .stat-card .stat-content {
        flex-grow: 1;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .stat-card .stat-label {
        font-size: 0.65rem;
    }

    .main-header {
        padding: 1rem 0.5rem;
        margin-bottom: 1rem;
        border-radius: 16px;
    }

    .main-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .main-header p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.75rem;
        font-size: 0.85rem;
        min-height: 44px; /* Touch target */
        border-radius: 12px;
    }

    .btn i {
        margin-right: 0.5rem;
    }

    .nav-link {
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 48px; /* Touch target */
        border-radius: 12px;
        margin: 0.25rem 0;
    }

    .nav-link i {
        font-size: 1.1rem;
        margin-right: 0.75rem;
    }

    .form-container {
        padding: 1rem;
        margin: 0 0.25rem;
        border-radius: 16px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .form-input, .form-select, .form-textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
        min-height: 44px; /* Touch target */
        border-radius: 12px;
    }

    .glass-card {
        border-radius: 16px;
        margin-bottom: 0.75rem;
    }

    .glass-card .card-content {
        padding: 1rem;
    }

    /* Mobile-specific adjustments */
    .flex.gap-3 {
        gap: 0.5rem !important;
    }

    .flex.gap-4 {
        gap: 0.75rem !important;
    }

    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .grid.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hide desktop header on mobile */
    .hidden.md\\:flex {
        display: none !important;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .main-content {
        padding: 0.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
    }

    .stat-card {
        padding: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
    }

    .stat-card .stat-icon {
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .stat-card .stat-content {
        flex-grow: 1;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .stat-card .stat-label {
        font-size: 0.6rem;
    }

    .main-header {
        padding: 0.75rem 0.25rem;
    }

    .btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }

    .form-input, .form-select, .form-textarea {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .glass-card:hover {
        transform: none;
        box-shadow: var(--glass-shadow);
    }

    .btn:hover {
        transform: none;
    }

    .nav-link:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    /* Better touch feedback */
    .btn:active {
        transform: scale(0.98);
    }

    .nav-link:active {
        transform: scale(0.98);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .glass-card {
        border-width: 0.5px;
    }

    .sidebar {
        border-right-width: 0.5px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .btn,
    .nav-link {
        display: none !important;
    }

    .glass-card {
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.7) 100%);
        --glass-border: rgba(255, 255, 255, 0.1);
    }

    body {
        color: #e2e8f0;
    }

    .main-header p {
        color: #a0aec0;
    }

    .stat-card .stat-label {
        color: #a0aec0;
    }

    .form-label {
        color: #e2e8f0;
    }
}