/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title {
    font-size: 13px;
    font-weight: 600;
}

.card-body {
    padding: 16px;
}

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

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 16px;
}

.stat-icon.purple {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.stat-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.orange {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Table */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 8px 12px;
    text-align: left;
}

th {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

td {
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

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

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-purple {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.badge-green {
    background: var(--success-light);
    color: var(--success);
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

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

/* Time Entry Form */
.time-entry-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #faf5ff 100%);
    border: 1px solid var(--accent-light);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.time-slot {
    padding: 6px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 12px;
    background: var(--bg-secondary);
}

.time-slot:hover {
    border-color: var(--accent-secondary);
    background: var(--accent-light);
}

.time-slot.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
}

.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    resize: vertical;
    min-height: 60px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

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

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

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

.empty-state-text {
    font-size: 13px;
    margin-bottom: 4px;
}

.empty-state-subtext {
    font-size: 11px;
    color: var(--text-muted);
}

/* Compact CTA button — overrides btn-primary width:100% */
.btn-compact {
    width: auto;
}

/* Toolbar (search + sort + action) */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1 1 0%;
    min-width: 200px;
    max-width: 600px;
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    padding-left: 34px;
}

.toolbar .form-select {
    width: 170px;
    flex-shrink: 0;
}

.btn-outline {
    width: auto;
    background: var(--bg-primary);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    box-shadow: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-outline:hover {
    background: var(--accent-light);
    transform: none;
    box-shadow: none;
}

.toolbar .btn {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Customer avatar */
.customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Kebab menu */
.kebab-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.15s;
}

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

.kebab-menu {
    position: absolute;
    right: 12px;
    top: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 60;
    display: none;
    overflow: hidden;
}

.kebab-menu.open {
    display: block;
}

.kebab-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-primary);
}

.kebab-menu button:hover {
    background: var(--bg-tertiary);
}

.kebab-menu .kebab-danger {
    color: var(--danger);
}

.kebab-menu .kebab-danger:hover {
    background: var(--danger-light);
}

