/* Mobile styles for Tasks Due Today List section */
@media (max-width: 700px) {
    .task-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }
    .task-table table, .task-table thead, .task-table tbody, .task-table th, .task-table td, .task-table tr {
        display: block;
    }
    .task-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
        padding: 1rem;
    }
    .task-table th, .task-table td {
        padding: 0.5rem 0.5rem;
        text-align: left;
        border-bottom: none;
    }
    .task-table th {
        background: none;
        color: #232946;
        font-weight: bold;
    }
    .task-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #007bff;
        display: block;
        margin-bottom: 0.3rem;
    }
    .task-table td {
        border-bottom: 1px solid #eee;
    }
    .task-table tr:last-child td {
        border-bottom: none;
    }
    .task-table th, .task-table td {
        width: 100%;
        box-sizing: border-box;
    }
    .task-table thead {
        display: none;
    }
    .task-table {
        margin-bottom: 1rem;
    }
    form[method="get"] {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }
    form[method="get"] label,
    form[method="get"] select,
    form[method="get"] input,
    form[method="get"] button {
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* Mobile styles for dashboard graphs section */
@media (max-width: 700px) {
    .dashboard-charts {
        margin-top: 2rem !important;
    }
    .dashboard-charts > div {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: stretch !important;
    }
    .dashboard-charts canvas {
        max-width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
    }
    .dashboard-charts [style*="max-width:30%"],
    .dashboard-charts [style*="max-width:70%"] {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        padding: 1rem !important;
    }
    .dashboard-charts [style*="display:flex"] {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    .dashboard-charts h3, .dashboard-charts h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.7rem !important;
    }
    .dashboard-charts > div {
        margin: 0 !important;
    }
}

/* Mobile styles for employee table and form */
@media (max-width: 700px) {
    .employee-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }
    .employee-table table, .employee-table thead, .employee-table tbody, .employee-table th, .employee-table td, .employee-table tr {
        display: block;
    }
    .employee-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
        padding: 1rem;
    }
    .employee-table th, .employee-table td {
        padding: 0.5rem 0.5rem;
        text-align: left;
        border-bottom: none;
    }
    .employee-table th {
        background: none;
        color: #232946;
        font-weight: bold;
    }
    .employee-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #007bff;
        display: block;
        margin-bottom: 0.3rem;
    }
    .employee-table td {
        border-bottom: 1px solid #eee;
    }
    .employee-table tr:last-child td {
        border-bottom: none;
    }
    .employee-table th, .employee-table td {
        width: 100%;
        box-sizing: border-box;
    }
    .employee-table thead {
        display: none;
    }
    .employee-table {
        margin-bottom: 1rem;
    }
    .form-section {
        max-width: 100% !important;
        padding: 1rem !important;
    }
}

/* Mobile styles for reports page tables and charts */
@media (max-width: 700px) {
    .task-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }
    .task-table table, .task-table thead, .task-table tbody, .task-table th, .task-table td, .task-table tr {
        display: block;
    }
    .task-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
        padding: 1rem;
    }
    .task-table th, .task-table td {
        padding: 0.5rem 0.5rem;
        text-align: left;
        border-bottom: none;
    }
    .task-table th {
        background: none;
        color: #232946;
        font-weight: bold;
    }
    .task-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #007bff;
        display: block;
        margin-bottom: 0.3rem;
    }
    .task-table td {
        border-bottom: 1px solid #eee;
    }
    .task-table tr:last-child td {
        border-bottom: none;
    }
    .task-table th, .task-table td {
        width: 100%;
        box-sizing: border-box;
    }
    .task-table thead {
        display: none;
    }
    .task-table {
        margin-bottom: 1rem;
    }
    .dashboard-charts, .report-charts {
        margin-top: 2rem !important;
    }
    .dashboard-charts > div, .report-charts > div {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: stretch !important;
    }
    .dashboard-charts canvas, .report-charts canvas {
        max-width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
    }
    .dashboard-charts [style*="max-width:30%"],
    .dashboard-charts [style*="max-width:70%"],
    .report-charts [style*="max-width:30%"],
    .report-charts [style*="max-width:70%"] {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        padding: 1rem !important;
    }
    .dashboard-charts [style*="display:flex"],
    .report-charts [style*="display:flex"] {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    .dashboard-charts h3, .dashboard-charts h4, .report-charts h3, .report-charts h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.7rem !important;
    }
    .dashboard-charts > div, .report-charts > div {
        margin: 0 !important;
    }
}

/* Mobile styles for subscriptions page tables and forms */
@media (max-width: 700px) {
    .subscription-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }
    .subscription-table table, .subscription-table thead, .subscription-table tbody, .subscription-table th, .subscription-table td, .subscription-table tr {
        display: block;
    }
    .subscription-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
        padding: 1rem;
    }
    .subscription-table th, .subscription-table td {
        padding: 0.5rem 0.5rem;
        text-align: left;
        border-bottom: none;
    }
    .subscription-table th {
        background: none;
        color: #232946;
        font-weight: bold;
    }
    .subscription-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #007bff;
        display: block;
        margin-bottom: 0.3rem;
    }
    .subscription-table td {
        border-bottom: 1px solid #eee;
    }
    .subscription-table tr:last-child td {
        border-bottom: none;
    }
    .subscription-table th, .subscription-table td {
        width: 100%;
        box-sizing: border-box;
    }
    .subscription-table thead {
        display: none;
    }
    .subscription-table {
        margin-bottom: 1rem;
    }
    .form-section {
        max-width: 100% !important;
        padding: 1rem !important;
    }
}

/* Mobile styles for active and expired subscriptions tables */
@media (max-width: 700px) {
    .active-subscription-table, .expired-subscription-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }
    .active-subscription-table table, .active-subscription-table thead, .active-subscription-table tbody, .active-subscription-table th, .active-subscription-table td, .active-subscription-table tr,
    .expired-subscription-table table, .expired-subscription-table thead, .expired-subscription-table tbody, .expired-subscription-table th, .expired-subscription-table td, .expired-subscription-table tr {
        display: block;
    }
    .active-subscription-table tr, .expired-subscription-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
        padding: 1rem;
    }
    .active-subscription-table th, .active-subscription-table td,
    .expired-subscription-table th, .expired-subscription-table td {
        padding: 0.5rem 0.5rem;
        text-align: left;
        border-bottom: none;
    }
    .active-subscription-table th, .expired-subscription-table th {
        background: none;
        color: #232946;
        font-weight: bold;
    }
    .active-subscription-table td:before, .expired-subscription-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #007bff;
        display: block;
        margin-bottom: 0.3rem;
    }
    .active-subscription-table td, .expired-subscription-table td {
        border-bottom: 1px solid #eee;
    }
    .active-subscription-table tr:last-child td, .expired-subscription-table tr:last-child td {
        border-bottom: none;
    }
    .active-subscription-table th, .active-subscription-table td,
    .expired-subscription-table th, .expired-subscription-table td {
        width: 100%;
        box-sizing: border-box;
    }
    .active-subscription-table thead, .expired-subscription-table thead {
        display: none;
    }
    .active-subscription-table, .expired-subscription-table {
        margin-bottom: 1rem;
    }
}

/* Mobile styles for charts and graphs in reports.php */
@media (max-width: 700px) {
    .charts-row {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: stretch !important;
    }
    .chart-card {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    .charts-row .pie, .charts-row .bar {
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    .chart-card canvas {
        max-width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
    }
    .charts-row h3, .charts-row h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.7rem !important;
    }
    .charts-row > div {
        margin: 0 !important;
    }
    .report-charts {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: stretch !important;
    }
    .report-charts .chart-card {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    .report-charts canvas {
        max-width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
    }
}

/* Mobile styles for Top 5 Employees and Priority Wise Pending Tasks charts */
@media (max-width: 700px) {
    .top-employees-section, .priority-pending-section {
        max-width: 100% !important;
        flex: 1 1 100% !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        box-sizing: border-box;
    }
    .top-employees-section h3, .priority-pending-section h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.7rem !important;
    }
    .top-employees-section canvas, .priority-pending-section canvas {
        max-width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
    }
    .charts-row, .top-priority-row {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: stretch !important;
        margin: 0 !important;
    }
}

/* Mobile styles for successful orders table */
@media (max-width: 700px) {
    .successful-orders-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 8px;
    }
    .successful-orders-table table, .successful-orders-table thead, .successful-orders-table tbody, .successful-orders-table th, .successful-orders-table td, .successful-orders-table tr {
        display: block;
    }
    .successful-orders-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(44,62,80,0.08);
        padding: 1rem;
    }
    .successful-orders-table th, .successful-orders-table td {
        padding: 0.5rem 0.5rem;
        text-align: left;
        border-bottom: none;
    }
    .successful-orders-table th {
        background: none;
        color: #232946;
        font-weight: bold;
    }
    .successful-orders-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #007bff;
        display: block;
        margin-bottom: 0.3rem;
    }
    .successful-orders-table td {
        border-bottom: 1px solid #eee;
    }
    .successful-orders-table tr:last-child td {
        border-bottom: none;
    }
    .successful-orders-table th, .successful-orders-table td {
        width: 100%;
        box-sizing: border-box;
    }
    .successful-orders-table thead {
        display: none;
    }
    .successful-orders-table {
        margin-bottom: 1rem;
    }
}

/* Mobile styles for company profile form */
@media (max-width: 700px) {
    .profile-box {
        max-width: 100% !important;
        margin: 2rem 1rem !important;
        padding: 1rem !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 16px rgba(44,62,80,0.10) !important;
    }
    .profile-box h2 {
        font-size: 1.3rem !important;
        margin-bottom: 1rem !important;
    }
    .profile-box label,
    .profile-box input,
    .profile-box textarea,
    .profile-box button {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin-bottom: 0.7rem !important;
    }
    .profile-box input,
    .profile-box textarea {
        padding: 0.7rem !important;
        font-size: 1rem !important;
    }
    .profile-box button {
        padding: 0.8rem 1.5rem !important;
        font-size: 1rem !important;
    }
}

/* Dashboard Statistics Cards Styling */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: block;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    text-decoration: none !important;
}

.stat-card.total { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
}

.stat-card.pending { 
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); 
}

.stat-card.inprogress { 
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); 
}

.stat-card.completed { 
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); 
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.stat-link-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.8rem;
}

.stat-card:hover .stat-link-indicator {
    opacity: 0.7;
}

.stat-card, 
.stat-card:visited, 
.stat-card:hover, 
.stat-card:active {
    color: white !important;
    text-decoration: none !important;
}

.stat-card * {
    color: white !important;
}

/* Task Details Attachment Styling */
.task-attachment {
    margin-top: 0.5rem;
}

.attachment-link {
    color: #007bff !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.attachment-link:hover {
    background: rgba(0, 123, 255, 0.2);
    text-decoration: none;
    transform: translateY(-1px);
}

.attachment-link i {
    margin-right: 0.5rem;
    color: #007bff;
}

/* Employee Phone Number Styling */
.phone-number {
    font-family: monospace;
    color: #495057;
    font-size: 0.95rem;
}

.phone-number:empty::before {
    content: "Not provided";
    color: #6c757d;
    font-style: italic;
    font-family: inherit;
}

/* Dashboard General Styling */
body { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    background: #f4f6fb; 
    margin: 0; 
}

.main { 
    margin-left: 240px; 
    padding: 2rem; 
}

.welcome { 
    font-size: 1.2rem; 
    margin-bottom: 2rem; 
    color: #232946; 
}

.dashboard-charts { 
    margin-top: 3rem; 
}

.task-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 2rem; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(44,62,80,0.08); 
}

.task-table th, 
.task-table td { 
    padding: 0.75rem 1rem; 
    text-align: left; 
}

.task-table th { 
    background: #232946; 
    color: #fff; 
}

.task-table tr:nth-child(even) { 
    background: #f4f6fb; 
}

.task-table td { 
    border-bottom: 1px solid #eee; 
}

.btn {
    background: #007bff;
    color: #fff;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #0056b3;
}

a.status {
    color: #28a745;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.actions a.status i {
    margin-right: 6px;
    font-size: 1em;
}

/* Dashboard Mobile Styles */
@media (max-width: 700px) {
    .main { 
        margin-left: 0; 
        padding: 1rem; 
        margin-top: 3rem; 
    }
    
    table.task-table, 
    .task-table thead, 
    .task-table tbody, 
    .task-table th, 
    .task-table td, 
    .task-table tr { 
        display: block; 
        width: 100%; 
    }
    
    .task-table thead tr { 
        display: none; 
    }
    
    .task-table tr { 
        margin-bottom: 1rem; 
        background: #fff; 
        border-radius: 8px; 
        box-shadow: 0 2px 8px rgba(44,62,80,0.08); 
    }
    
    .task-table td {
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid #eee;
        min-height: 40px;
        box-sizing: border-box;
    }
    
    .task-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        top: 0;
        width: 45%;
        font-weight: bold;
        color: #232946;
        white-space: nowrap;
    }
    
    .dashboard-charts { 
        overflow-x: auto; 
    }
    
    .dashboard-charts > div { 
        flex-direction: column; 
        gap: 1rem; 
    }
    
    .dashboard-charts canvas { 
        max-width: 100% !important; 
        height: auto !important; 
    }
    
    /* Make comment sections stack vertically on mobile */
    div[style*="grid-template-columns:1fr 1fr"] {
        display: block !important;
    }
    
    div[style*="grid-template-columns:1fr 1fr"] > div {
        margin-bottom: 2rem !important;
    }
    
    /* Mobile styling for Details buttons */
    div[style*="text-align:right"] a {
        display: inline-block;
        padding: 0.25rem 0.5rem;
        background: rgba(0,123,255,0.1);
        border-radius: 4px;
        margin-top: 0.5rem;
    }
}

/* Mobile styling for statistics cards */
@media (max-width: 700px) {
    .stats-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1.2rem !important;
    }
    
    .stat-icon {
        font-size: 2rem !important;
    }
    
    .stat-number {
        font-size: 1.8rem !important;
    }
}
