/* iOS-Style Task Management System with Light/Dark Theme */

/* CSS Variables - Light Theme (Default) */
:root {
    /* Light Theme Colors */
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --text-primary: #000000;
    --text-secondary: #3c3c43;
    --text-tertiary: #8e8e93;
    --separator: #c6c6c8;
    --accent-blue: #007aff;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    --accent-orange: #ff9500;
    --accent-purple: #af52de;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #ebebf5;
    --text-tertiary: #8e8e93;
    --separator: #38383a;
    --accent-blue: #0a84ff;
    --accent-green: #32d74b;
    --accent-red: #ff453a;
    --accent-orange: #ff9f0a;
    --accent-purple: #bf5af2;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.mobile-app {
    background-color: #f5f5f5;
}

[data-theme="dark"] body.mobile-app {
    background-color: #000000;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Mobile App Style Header */
.header {
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
    color: white;
    padding: 12px 16px;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header.mobile-app-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: center;
}

.header.mobile-app-header .header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.header.mobile-app-header .header-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.header.mobile-app-header .header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:active {
    opacity: 0.7;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-align: center;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.header.mobile-app-header .notification-icon {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.header.mobile-app-header .notification-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header.mobile-app-header .notification-badge {
    border-color: #007aff;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Notification Icon & Dropdown */
.notification-container {
    position: relative;
    display: inline-block;
}

.notification-icon {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 22px;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

.notification-icon:hover,
.notification-icon:active {
    background-color: var(--bg-tertiary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: var(--accent-red);
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    padding: 0 6px;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-badge.hidden {
    display: none;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: 500px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 0.5px solid var(--separator);
    overflow: hidden;
    display: none;
    z-index: 1001;
    animation: slideDown 0.2s ease;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-header {
    padding: 16px;
    border-bottom: 0.5px solid var(--separator);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-tertiary);
}

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

.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notification-close:hover {
    background-color: var(--bg-secondary);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--separator);
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.notification-item:hover,
.notification-item:active {
    background-color: var(--bg-tertiary);
}

.notification-item.unread {
    background-color: rgba(0, 122, 255, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent-blue);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-message {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-type {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: capitalize;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.notification-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-tertiary);
}

.notification-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.notification-footer {
    padding: 12px 16px;
    border-top: 0.5px solid var(--separator);
    text-align: center;
    background-color: var(--bg-tertiary);
}

.notification-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* Click outside to close */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    background: transparent;
}

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

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 51px;
    height: 31px;
    background-color: var(--separator);
    border-radius: 31px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    padding: 0;
    margin: 0 8px;
}

.theme-toggle.active {
    background-color: var(--accent-green);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle.active::after {
    transform: translateX(20px);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* iOS-Style Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    letter-spacing: -0.2px;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.8;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-blue);
    opacity: 0.9;
}

.btn-success {
    background-color: var(--accent-green);
    color: white;
}

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

.btn-warning {
    background-color: var(--accent-orange);
    color: white;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 15px;
}

/* iOS-Style Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 0.5px solid var(--separator);
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 0.5px solid var(--separator);
    border-radius: var(--border-radius);
    font-size: 17px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: var(--bg-secondary);
}

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

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

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 32px);
    padding: 16px;
}

.login-box {
    background-color: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-info {
    margin-top: 24px;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-secondary);
}

.login-info code {
    background-color: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 64px 16px;
    color: var(--text-primary);
}

.welcome-section h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.welcome-section p {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 15px;
    border-left: 4px solid;
}

.alert-error {
    background-color: rgba(255, 59, 48, 0.1);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.alert-info {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Task Cards */
.task-card {
    border-left: 4px solid var(--accent-blue);
    position: relative;
}

.task-card.high-priority {
    border-left-color: var(--accent-red);
}

.task-card.medium-priority {
    border-left-color: var(--accent-orange);
}

.task-card.low-priority {
    border-left-color: var(--accent-green);
}

.task-card.completed {
    opacity: 0.6;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.task-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.task-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 14px;
}

/* Badges */
.priority-badge,
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.priority-high {
    background-color: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
}

.priority-medium {
    background-color: rgba(255, 149, 0, 0.2);
    color: var(--accent-orange);
}

.priority-low {
    background-color: rgba(52, 199, 89, 0.2);
    color: var(--accent-green);
}

.status-pending {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.status-in_progress {
    background-color: rgba(0, 122, 255, 0.2);
    color: var(--accent-blue);
}

.status-completed {
    background-color: rgba(52, 199, 89, 0.2);
    color: var(--accent-green);
}

.status-overdue {
    background-color: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
}

.status-admin,
.status-user {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Timer */
.timer {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.timer.warning {
    background-color: rgba(255, 149, 0, 0.2);
    color: var(--accent-orange);
}

.timer.danger {
    background-color: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Filters */
.filters {
    background-color: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.filters form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filters label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.filters select,
.filters input {
    padding: 10px 14px;
    background-color: var(--bg-tertiary);
    border: 0.5px solid var(--separator);
    border-radius: var(--border-radius);
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    background-color: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.stat-label {
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Table */
.table-container {
    overflow-x: auto;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 0.5px solid var(--separator);
    font-size: 15px;
}

table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background-color: var(--bg-tertiary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Points Badge */
.points-badge {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Notes Section */
.notes-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 0.5px solid var(--separator);
}

.note-item {
    background-color: var(--bg-tertiary);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    font-size: 14px;
}

.note-author {
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.note-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow: auto;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 10% auto;
    padding: 24px;
    border-radius: var(--border-radius-xl);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
}

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

.close {
    font-size: 28px;
    font-weight: 300;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--text-primary);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive - iOS Style */
@media (max-width: 768px) {
    body {
        padding-top: calc(var(--safe-area-top) + 8px);
    }

    .container {
        padding: 12px;
    }

    .header {
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header-nav {
        width: 100%;
        justify-content: space-between;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .card {
        padding: 14px;
        border-radius: var(--border-radius);
    }

    .card-title {
        font-size: 20px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

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

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

    .filters form {
        flex-direction: column;
        align-items: stretch;
    }

    .filters > * {
        width: 100%;
    }

    .task-header {
        flex-direction: column;
    }

    .welcome-section {
        padding: 40px 16px;
    }

    .welcome-section h1 {
        font-size: 36px;
    }

    .welcome-section p {
        font-size: 18px;
    }

    .login-box {
        padding: 24px;
        border-radius: var(--border-radius-lg);
    }

    .login-box h2 {
        font-size: 28px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        border-radius: var(--border-radius-lg);
    }

    table {
        font-size: 14px;
    }

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

    .btn {
        padding: 10px 20px;
        font-size: 16px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* Notification dropdown mobile */
    .notification-dropdown {
        width: calc(100vw - 32px);
        max-width: 360px;
        right: 0;
        left: auto;
    }

    .notification-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .notification-badge {
        min-width: 18px;
        height: 18px;
        font-size: 11px;
        top: 4px;
        right: 4px;
    }

    /* Mobile app header adjustments */
    .header.mobile-app-header {
        grid-template-columns: auto 1fr auto;
        padding: 10px 12px;
    }

    .header-title {
        font-size: 18px;
    }

    .header-subtitle {
        font-size: 11px;
    }

    .mobile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .mobile-action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .mobile-action-btn {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .header {
        padding: 8px 10px;
    }

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 32px;
    }

    .card {
        padding: 12px;
    }

    .login-box {
        padding: 20px;
    }

    .welcome-section h1 {
        font-size: 32px;
    }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

/* Mobile Sidebar Menu */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--bg-secondary);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-sidebar.show {
    transform: translateX(0);
}

.mobile-sidebar-header {
    padding: 16px;
    border-bottom: 0.5px solid var(--separator);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
    color: white;
}

.mobile-sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-sidebar-menu {
    padding: 16px 0;
}

.mobile-sidebar-menu a {
    display: block;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-sidebar-menu a:hover,
.mobile-sidebar-menu a:active {
    background-color: var(--bg-tertiary);
    border-left-color: var(--accent-blue);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Mobile App Stats Grid */
.mobile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-primary);
}

.mobile-stat-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.mobile-stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-stat-value .highlight {
    color: var(--accent-green);
    font-weight: 700;
}

.mobile-stat-value .total {
    color: var(--text-tertiary);
    font-size: 18px;
    font-weight: 500;
}

/* Mobile App Action Buttons */
.mobile-action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-primary);
}

.mobile-action-btn {
    background: linear-gradient(135deg, var(--accent-green) 0%, #2db84a 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.mobile-action-btn:hover,
.mobile-action-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
    opacity: 0.95;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
