/* Dashboard Responsive Design - DHA Bahawalpur */

/* Ultra Wide Desktop (2560px and above ONLY) - Perfect Standard Desktop Layout */
@media (min-width: 2560px) and (max-width: 9999px) {
    /* Main Layout Structure - Centered with fixed sidebar */
    .dashboard-layout {
        max-width: 2560px;
        margin: 0 auto;
        display: flex;
        background: #f8fafc;
        position: relative;
    }
    
    /* Sidebar - Fixed Position Left Side */
    .sidebar {
        width: 320px !important;
        min-width: 320px;
        position: fixed !important;
        left: calc(50% - 1280px) !important;
        top: 0;
        height: 100vh;
        z-index: 100;
        background: white;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        transform: none !important;
        transition: none !important;
    }
    
    /* Main Content - Centered Layout */
    .main-content {
        margin-left: calc(50% - 960px) !important;
        width: calc(2560px - 320px) !important;
        max-width: 2240px;
        flex: 1;
        min-height: 100vh;
        background: #f8fafc;
        padding-left: 320px !important;
    }
    
    /* Header - Desktop Style - Fixed Alignment */
    .header {
        height: 80px !important;
        padding: 0 3rem !important;
        background: white;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
        position: sticky;
        top: 0;
        z-index: 50;
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .page-title {
        font-size: 1.8rem !important;
        font-weight: 700;
        color: var(--text-primary);
    }
    
    /* Content Area */
    .content {
        padding: 3rem !important;
        max-width: 2240px;
        width: 100%;
    }
    
    /* Stats Grid - 4 Column Layout */
    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2rem !important;
        margin-bottom: 3rem !important;
    }
    
    .stat-card {
        padding: 2rem !important;
        min-height: 160px !important;
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative;
        overflow: hidden;
        text-align: center;
        gap: 1rem !important;
    }
    
    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    }
    
    .stat-number {
        font-size: 2.8rem !important;
        font-weight: 800;
        color: var(--primary-color);
        margin: 1rem 0 0.5rem 0;
        line-height: 1;
    }
    
    .stat-title {
        font-size: 1rem !important;
        color: var(--text-secondary);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .stat-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin: 0 !important;
        order: 1 !important;
    }
    
    .stat-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        order: 2 !important;
    }
    
    .stat-number {
        margin: 0 0 0.5rem 0 !important;
    }
    
    .stat-title {
        margin: 0 !important;
    }
    
    /* Dashboard Row - 2 Column Layout */
    .dashboard-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 3rem !important;
        margin-bottom: 3rem !important;
    }
    
    /* Quick Actions Section */
    .quick-actions {
        padding: 2.5rem !important;
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
        height: fit-content;
    }
    
    .section-title {
        font-size: 1.6rem !important;
        margin-bottom: 2rem !important;
        color: var(--text-primary);
        font-weight: 700;
    }
    
    .actions-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .action-card {
        padding: 2.5rem !important;
        min-height: 180px !important;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        transition: all 0.3s ease;
        cursor: pointer;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .action-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
        border-color: var(--primary-color);
        background: white;
    }
    
    .action-icon {
        width: 80px !important;
        height: 80px !important;
        font-size: 2.2rem !important;
        margin-bottom: 1.5rem !important;
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .action-content h3 {
        font-size: 1.3rem !important;
        margin-bottom: 0.8rem !important;
        color: var(--text-primary);
        font-weight: 600;
    }
    
    .action-content p {
        font-size: 1rem !important;
        line-height: 1.6;
        color: var(--text-secondary);
    }
    
    /* Applications List Section */
    .apps-list {
        padding: 2.5rem !important;
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
        height: fit-content;
    }
    
    .app-item {
        padding: 2rem !important;
        margin-bottom: 1.5rem !important;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.3s ease;
    }
    
    .app-item:hover {
        background: white;
        border-color: var(--primary-color);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    .app-item:last-child {
        margin-bottom: 0;
    }
    
    .app-id {
        font-size: 1.1rem !important;
        font-weight: 700;
        color: var(--primary-color);
    }
    
    .app-details h4 {
        font-size: 1.2rem !important;
        margin-bottom: 0.8rem !important;
        color: var(--text-primary);
    }
    
    .app-date {
        font-size: 1rem !important;
        color: var(--text-secondary);
    }
    
    .status-badge {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.9rem !important;
        min-width: 120px !important;
        border-radius: 20px;
        font-weight: 600;
        text-align: center;
    }
    
    .action-btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.95rem !important;
        border-radius: 8px;
        font-weight: 600;
        transition: all 0.3s ease;
    }
    
    /* Form Sections */
    .form-container,
    .ballot-form-wrapper {
        max-width: 1400px !important;
        margin: 0 auto;
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
        padding: 3rem !important;
    }
    
    .form-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .form-group.full-width {
        grid-column: 1 / -1 !important;
    }
    
    /* Applications Table */
    .applications-table-container {
        padding: 2.5rem !important;
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
        margin-bottom: 2rem;
    }
    
    .applications-table {
        font-size: 1rem !important;
        width: 100%;
    }
    
    .applications-table th,
    .applications-table td {
        padding: 1.2rem !important;
    }
    
    /* Profile Section */
    .profile-container {
        max-width: 1400px !important;
        margin: 0 auto;
    }
    
    .profile-grid {
        display: grid !important;
        grid-template-columns: 1fr 2fr !important;
        gap: 3rem !important;
    }
    
    /* Help & Support */
    .help-container {
        max-width: 1600px !important;
        margin: 0 auto;
    }
    
    .contact-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
    
    /* Header User Actions */
    .header-right {
        display: flex !important;
        align-items: center;
        gap: 1.5rem !important;
    }
    
    .notification-btn {
        width: 45px !important;
        height: 45px !important;
        border-radius: 50%;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: var(--text-secondary);
        position: relative;
        transition: all 0.3s ease;
    }
    
    .notification-btn:hover {
        background: #e2e8f0;
        border-color: var(--primary-color);
    }
    
    .user-dropdown .user-avatar {
        width: 45px !important;
        height: 45px !important;
        border-radius: 50%;
    }
    
    /* Mobile Elements Hidden */
    .mobile-menu-btn {
        display: none !important;
    }
    
    .backdrop {
        display: none !important;
    }
    
    .sidebar-close {
        display: none !important;
    }
    
    /* Sidebar Always Visible */
    .sidebar.active,
    .sidebar {
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Sidebar Styling */
    .logo-container {
        padding: 2rem !important;
        border-bottom: 1px solid #e2e8f0;
        text-align: center;
    }
    
    .logo-img {
        max-width: 200px !important;
        height: auto;
    }
    
    .nav-menu {
        padding: 2rem 0 !important;
    }
    
    .nav-item {
        margin-bottom: 0.5rem !important;
    }
    
    .nav-link {
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
        display: flex;
        align-items: center;
        gap: 1rem;
        transition: all 0.3s ease;
        border-radius: 0 25px 25px 0;
        margin-right: 1rem;
    }
    
    .nav-link:hover {
        background: #f1f5f9;
        color: var(--primary-color);
    }
    
    .nav-item.active .nav-link {
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        color: white;
    }
    
    .nav-icon {
        width: 24px !important;
        height: 24px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem !important;
    }
    
    .nav-text {
        font-weight: 500;
    }
    
    .sidebar-footer {
        padding: 2rem !important;
        border-top: 1px solid #e2e8f0;
        margin-top: auto;
    }
    
    .logout-btn {
        width: 100% !important;
        padding: 1rem !important;
        background: #fee2e2;
        color: #dc2626;
        border: 1px solid #fecaca;
        border-radius: 8px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        transition: all 0.3s ease;
    }
    
    .logout-btn:hover {
        background: #fecaca;
        border-color: #dc2626;
        transform: translateY(-1px);
    }
    
    /* 2560px - Keep Desktop Style Vertical Layout */
    /* No override needed - using default vertical layout from above */
    
    /* Header Alignment Fix for 2560px */
    .header {
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: 3rem !important;
    }
    
    /* Perfect Desktop Layout Override - Exactly like 2nd Image */
    .stat-card {
        padding: 2rem !important;
        min-height: 160px !important;
        justify-content: center !important;
        gap: 1rem !important;
    }
    
    .stat-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
        margin: 0 !important;
    }
    
    .stat-content {
        gap: 0.5rem !important;
    }
    
    .stat-number {
        font-size: 2.5rem !important;
    }
    
    .stat-title {
        font-size: 0.9rem !important;
    }
    
    /* Perfect Desktop Layout Override - Exactly like 2nd Image */
    .stat-card {
        padding: 2rem !important;
        min-height: 160px !important;
        justify-content: center !important;
        gap: 1rem !important;
    }
    
    .stat-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
        margin: 0 !important;
    }
    
    .stat-content {
        gap: 0.5rem !important;
    }
    
    .stat-number {
        font-size: 2.5rem !important;
    }
    
    .stat-title {
        font-size: 0.9rem !important;
    }
    
    /* FINAL FIX - CORRECT HTML STRUCTURE FOR 2560px */
    .stat-card {
        padding: 2rem !important;
        min-height: 160px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    
    /* Reorder: Icon at top, then title below it */
    .stat-header {
        display: flex !important;
        flex-direction: column-reverse !important;
        align-items: center !important;
        gap: 1rem !important;
        order: 1 !important;
    }
    
    .stat-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
        margin: 0 !important;
        order: 1 !important;
    }
    
    .stat-title {
        font-size: 0.9rem !important;
        margin: 0 !important;
        order: 2 !important;
    }
    
    /* Number in middle */
    .stat-number {
        font-size: 2.5rem !important;
        order: 2 !important;
        margin: 0 !important;
    }
    
    /* Trend at bottom */
    .stat-trend {
        order: 3 !important;
        font-size: 0.8rem !important;
    }

}

/* Large Desktop (1920px - 2559px) - Optimized Layout */
@media (min-width: 1920px) and (max-width: 2559px) {
    .dashboard-layout {
        max-width: 1920px;
        margin: 0 auto;
        display: flex;
    }
    
    .sidebar {
        width: 300px;
        position: fixed;
        left: calc(50% - 960px);
        height: 100vh;
        z-index: 100;
    }
    
    .main-content {
        margin-left: calc(50% - 660px);
        width: calc(1920px - 300px);
        max-width: 1620px;
    }
    
    .content {
        padding: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.8rem;
    }
    
    .stat-card {
        padding: 2rem;
    }
    
    .dashboard-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

/* Large Desktop (1440px and above) */
@media (min-width: 1440px) {
    .dashboard-sidebar {
        width: 320px;
    }
    
    .dashboard-main {
        margin-left: 320px;
    }
    
    .dashboard-main.sidebar-collapsed {
        margin-left: 90px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .content-container {
        padding: 2.5rem;
    }
}

/* Desktop (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1024px) {
    .dashboard-sidebar {
        width: 260px;
    }
    
    .dashboard-main {
        margin-left: 260px;
    }
    
    .dashboard-main.sidebar-collapsed {
        margin-left: 70px;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.2rem;
    }
    
    .action-card {
        padding: 1.8rem;
    }
    
    .action-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .content-container {
        padding: 1.8rem;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.3rem;
        flex-direction: row;
        text-align: left;
        gap: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        flex-shrink: 0;
    }
    
    .stat-content h3 {
        font-size: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-card {
        padding: 1.5rem;
    }
    
    .action-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .action-card h3 {
        font-size: 1.1rem;
    }
    
    .action-card p {
        font-size: 0.85rem;
    }
    
    .content-container {
        padding: 1.5rem;
    }
    
    .dashboard-header {
        height: 70px;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
}

/* Mobile Large (480px - 767px) */
@media (max-width: 767px) and (min-width: 480px) {
    .dashboard-sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.2rem;
        flex-direction: row;
        gap: 1rem;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .stat-content h3 {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .quick-actions h2,
    .recent-applications h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-card {
        padding: 1.3rem;
    }
    
    .action-icon {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .action-card h3 {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .action-card p {
        font-size: 0.8rem;
        margin-bottom: 1.2rem;
    }
    
    .action-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .content-container {
        padding: 1.2rem;
    }
    
    .dashboard-header {
        height: 65px;
        padding: 0 1rem;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
    
    .header-right {
        gap: 1rem;
    }
    
    .user-info {
        display: none;
    }
    
    .notification-btn {
        padding: 0.6rem;
        font-size: 1rem;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Mobile Small (below 480px) */
@media (max-width: 479px) {
    .dashboard-sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: row;
        gap: 0.8rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-content h3 {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .quick-actions h2,
    .recent-applications h2 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .action-card h3 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .action-card p {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .action-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .content-container {
        padding: 1rem;
    }
    
    .dashboard-header {
        height: 60px;
        padding: 0 0.8rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .header-right {
        gap: 0.8rem;
    }
    
    .notification-btn {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .user-profile {
        padding: 0.4rem;
    }
    
    /* Show mobile applications cards on very small screens */
    .applications-table-container {
        display: none;
    }
    
    .mobile-applications-cards {
        display: block;
    }
    
    .mobile-app-card {
        padding: 1.2rem;
    }
    
    .mobile-app-info-item {
        padding: 0.5rem 0;
    }
    
    .mobile-app-info-label {
        font-size: 0.75rem;
    }
    
    .mobile-app-info-value {
        font-size: 0.8rem;
    }
    
    .mobile-app-actions {
        gap: 0.3rem;
    }
    
    .table-action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Sidebar Mobile Backdrop */
@media (max-width: 1023px) {
    .sidebar-backdrop {
        display: block;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Print Styles */
@media print {
    .dashboard-sidebar,
    .dashboard-header,
    .mobile-menu-toggle,
    .action-card,
    .table-action-btn {
        display: none !important;
    }
    
    .dashboard-main {
        margin-left: 0 !important;
    }
    
    .applications-table-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .applications-table {
        color: #000 !important;
    }
    
    .status-badge {
        color: #000 !important;
        border: 1px solid #ddd !important;
    }
}

/* Landscape Mobile Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .dashboard-header {
        height: 50px;
    }
    
    .content-container {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sidebar-logo,
    .user-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Responsive Styles */

/* Tablet Styles */
@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .sidebar {
        width: 260px;
    }
}

/* Mobile Landscape */
@media (max-width: 900px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .form-group.full-width {
        grid-column: 1 / -1;
    }
    
    .payment-table-container {
        overflow-x: auto;
    }
    
    .payment-table {
        min-width: 600px;
    }
}

/* Mobile Portrait and Small Screens */
@media (max-width: 768px) {
    /* Layout Adjustments */
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .backdrop.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Header Mobile Styles */
    .header {
        padding: 0 1rem;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-btn:hover {
        background: #f1f5f9;
        color: var(--primary-color);
    }
    
    .page-title {
        font-size: 1.4rem;
    }
    
    /* Sidebar Mobile Styles */
    .sidebar-close {
        display: block;
        position: absolute;
        top: 2rem;
        right: -4rem;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.2rem;
        cursor: pointer;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    .sidebar-close:hover {
        background: rgba(var(--primary-color-rgb), 0.1);
        color: var(--primary-color);
    }
    
    /* Content Mobile Styles */
    .content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Form Mobile Styles */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }
    
    .ballot-form-wrapper {
        padding: 1.5rem;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .instructions-panel {
        padding: 1rem;
    }
    
    .instructions-panel h4 {
        font-size: 1rem;
    }
    
    .instructions-panel li {
        font-size: 0.85rem;
    }
    
    /* Payment Table Mobile */
    .payment-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .payment-table {
        min-width: 700px;
        font-size: 0.85rem;
    }
    
    .payment-table th,
    .payment-table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    /* Form Actions Mobile */
    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Action Cards Mobile */
    .action-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Applications List Mobile */
    .apps-list {
        gap: 0.75rem;
    }
    
    .app-item {
        grid-template-columns: 1fr auto;
        gap: 1rem;
        padding: 1rem;
    }
    
    .app-id {
        font-size: 0.9rem;
        grid-column: 1;
        grid-row: 1;
    }
    
    .app-details {
        grid-column: 1;
        grid-row: 2;
    }
    
    .app-details h4 {
        font-size: 0.95rem;
    }
    
    .app-date {
        font-size: 0.8rem;
    }
    
    .status-badge {
        grid-column: 2;
        grid-row: 1;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .app-actions {
        grid-column: 2;
        grid-row: 2;
        gap: 0.5rem;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    /* Modal Mobile Styles */
    .modal-container {
        width: 95%;
        margin: 0 auto;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .modal-logo-img {
        width: 80px;
    }
    
    .modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-message {
        font-size: 0.9rem;
    }
    
    .modal-details {
        gap: 0.75rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Captcha Mobile */
    .captcha-container {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .captcha-image {
        width: 150px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .refresh-captcha {
        position: static;
        margin: 0;
    }
    
    /* Section Titles Mobile */
    .section-title {
        font-size: 1.25rem;
    }
    
    /* Placeholder Mobile */
    .placeholder {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .placeholder-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .placeholder h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .placeholder p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .header {
        padding: 0 0.75rem;
        height: 70px;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 0.75rem;
    }
    
    .ballot-form-wrapper {
        padding: 1rem;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .form-notice {
        padding: 0.75rem;
    }
    
    .form-notice p {
        font-size: 0.8rem;
    }
    
    .instructions-panel {
        padding: 0.75rem;
    }
    
    .instructions-panel h4 {
        font-size: 0.9rem;
    }
    
    .instructions-panel li {
        font-size: 0.8rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-title {
        font-size: 0.85rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-card h3 {
        font-size: 0.95rem;
    }
    
    .action-card p {
        font-size: 0.8rem;
    }
}

/* Landscape Mobile Fix */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 260px;
    }
    
    .header {
        height: 60px;
    }
    
    .content {
        padding: 1rem;
    }
    
    .modal-container {
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .backdrop,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .content {
        padding: 0 !important;
    }
    
    .ballot-form-wrapper {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
} 