:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--sticky-header-height, 0px);
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

.card {
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.badge {
    padding: 0.5em 0.75em;
}

/* Timer Display */
#timer-duration {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
}

#active-timer-display {
    border-left: 5px solid var(--success-color);
}

.sticky-header {
    position: fixed;
    top: 0;
    left: 72px;
    right: 0;
    z-index: 1055;
}

.active-timer-bar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.active-timer-duration {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.active-timer-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-bar-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
}

.timer-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timer-label {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.timer-meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

.timer-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.35);
}

@media (max-width: 768px) {
    .sticky-header {
        left: 0;
        top: 64px;
    }
    
    .timer-bar-row {
        grid-template-columns: 1fr;
    }

    .timer-divider {
        display: none;
    }
}

.active-timer-bar .punch-area {
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .active-timer-bar .active-timer-duration {
        font-size: 1rem;
    }
}

/* Progress bars */
.progress {
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
}

/* Cards hover effect */
.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

/* Table hover effect */
.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.025);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
}

/* List group items */
.list-group-item {
    border-left: 3px solid transparent;
    transition: border-left-color 0.3s ease;
}

.list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: #f8f9fa;
}

/* Alert customization */
.alert {
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Dashboard full-screen layout */
.dashboard-layout {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: 100vh;
    display: flex;
    background: #f4f6f9;
    color: #1f2933;
}

.dashboard-sidebar {
    width: 72px;
    background: #0f172a;
    color: #cbd5f5;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    gap: 1rem;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: #1e293b;
    color: #fff;
    font-size: 1.2rem;
}

.brand-text {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    align-items: center;
}

.sidebar-link {
    width: 64px;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: #cbd5f5;
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    font-size: 1rem;
    text-align: center;
}

.sidebar-link span {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #1e293b;
    color: #fff;
    border-color: #334155;
}

.sidebar-footer {
    margin-top: auto;
}

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 72px;
}

.dashboard-content {
    padding: 1.5rem;
}

.dashboard-layout .card,
.dashboard-layout .btn,
.dashboard-layout .form-control,
.dashboard-layout .badge,
.dashboard-layout .alert,
.dashboard-layout .list-group-item,
.dashboard-layout .modal-content,
.dashboard-layout .modal-header,
.dashboard-layout .modal-footer {
    border-radius: 0 !important;
}

.dashboard-layout .card {
    border: 1px solid #dfe3e8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.dashboard-layout .card-header {
    background: #f1f5f9;
    border-bottom: 1px solid #dfe3e8;
}

.stat-card {
    padding: 1rem;
    border: 1px solid #dfe3e8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.1rem;
}

.icon-pill {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
}

.active-timer,
.punch-active,
.active-users-summary {
    background: #f8fafc;
}

.active-user-avatar {
    background: #e2e8f0;
    color: #475569;
}

.punch-empty {
    color: #6b7280;
}

@media (max-width: 991px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-sidebar {
        flex-direction: row;
        width: 100%;
        height: 64px;
        padding: 0 1rem;
        justify-content: space-between;
    }
    .sidebar-nav {
        flex-direction: row;
    }
    .sidebar-link {
        width: 72px;
        height: 56px;
    }
}

/* Dashboard components */
.dashboard-card {
    border: 1px solid #dfe3e8;
    background: #fff;
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f1f5f9;
    border-bottom: 1px solid #dfe3e8;
    padding: 1rem 1.25rem;
}

.bg-purple {
    background: linear-gradient(135deg, #6f42c1, #a370f7);
}

.active-timer {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    background: #f8fafc;
    padding: 1rem;
}

.timer-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.timer-duration {
    text-align: left;
}

.timer-duration #timer-duration,
.punch-duration #punch-duration {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
}

.punch-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 0.75rem 1rem;
}

.punch-status {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.punch-duration {
    text-align: right;
}

.punch-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    padding: 0.5rem 0 1rem;
    font-size: 0.95rem;
}

.punch-empty i {
    font-size: 2rem;
}

.active-users-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.active-users-summary h3 {
    margin: 0;
}

.active-users-summary i {
    font-size: 1.4rem;
    color: #198754;
}

.active-users-list {
    max-height: 240px;
    overflow-y: auto;
}

.active-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.active-user:last-child {
    border-bottom: 0;
}

.active-user-avatar {
    width: 36px;
    height: 36px;
    background: #e2e8f0;
    display: grid;
    place-items: center;
    color: #475569;
}

.active-user-time {
    margin-left: auto;
}

#teamHoursChart {
    width: 100% !important;
    height: 180px !important;
}

@media (min-width: 992px) {
    .active-timer {
        grid-template-columns: 2fr 1fr auto;
        align-items: center;
    }
    .timer-duration {
        text-align: right;
    }
}
