/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: bold;
    font-size: 16px;
}

.user-role {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.btn-changelog {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 8px;
    font-size: 16px;
}

.btn-changelog:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.changelog-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    letter-spacing: 0.5px;
    pointer-events: none;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    margin-right: 15px;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    gap: 12px;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border-left-color: #667eea;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.lines-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #95a5a6;
    font-size: 13px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.lines-counter i {
    font-size: 16px;
    color: #667eea;
}

.lines-counter span {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f5f7fa;
    padding: 0;
}

.content-wrapper {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.content-wrapper h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
}

.content-wrapper > p {
    color: #7f8c8d;
    margin-bottom: 30px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 36px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #f0f4ff;
    border-radius: 8px;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-number {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #1a252f;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: #f8f9fa;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Weekly Statistics Table */
.weekly-stats-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.weekly-stats-container h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.weekly-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.weekly-stats-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.weekly-stats-table thead th {
    padding: 12px 15px;
    color: white;
    font-weight: 600;
    text-align: left;
    border: none;
}

.weekly-stats-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.weekly-stats-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.weekly-stats-table thead th:not(:first-child) {
    text-align: right;
}

.weekly-stats-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s;
}

.weekly-stats-table tbody tr:last-child {
    border-bottom: none;
}

.weekly-stats-table tbody tr:hover {
    background-color: #f8f9fa;
}

.weekly-stats-table tbody td {
    padding: 12px 15px;
    color: #2c3e50;
}

.weekly-stats-table tbody td:first-child {
    font-weight: 600;
    color: #667eea;
}

.weekly-stats-table tbody td:not(:first-child) {
    text-align: right;
}

.weekly-stats-table .total-cell {
    font-weight: 700;
    color: #2c3e50;
}

.weekly-stats-table .overtime-cell {
    color: #e74c3c;
    font-weight: 600;
}

.weekly-stats-table .night-cell {
    color: #6c5ce7;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn i {
    margin-right: 5px;
}

/* Forms */
.form-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

.filter-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-grid .form-group {
    margin-bottom: 0 !important;
    flex: 1 1 150px;
    min-width: 150px;
    max-width: 250px;
}

.filter-grid .form-group button {
    margin-top: 23px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #2c3e50;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #667eea !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background-color: #667eea !important;
    color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }

    .app-title {
        font-size: 14px !important;
    }

    .main-wrapper {
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        padding-top: 80px;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-nav ul {
        display: flex;
        flex-direction: column;
    }

    .nav-item {
        white-space: nowrap;
    }

    .header {
        padding: 15px;
    }

    .header-left {
        flex: 1;
    }

    .header-right {
        gap: 15px;
    }

    .user-info {
        display: none;
    }

    .content-wrapper {
        padding: 15px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    /* Action buttons responsive */
    .dataTables_wrapper table td:last-child {
        min-width: 120px;
        white-space: nowrap;
    }

    .btn-sm {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 36px;
        min-height: 36px;
        margin: 2px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
    }

    .btn-sm i {
        margin-right: 3px;
        font-size: 12px;
    }

    /* Overlay when menu is open */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

@media (max-width: 480px) {
    .app-logo-icon {
        display: none !important;
    }

    .app-title {
        font-size: 12px !important;
    }

    .user-role {
        display: none;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Icon-only buttons for very small screens */
    .btn-sm {
        padding: 8px;
        width: 36px;
        height: 36px;
        font-size: 0;
    }

    .btn-sm i {
        margin-right: 0;
        font-size: 14px;
    }

    .dataTables_wrapper table td:last-child {
        white-space: nowrap;
    }
}
