/* =====================
   Common Styles
   ===================== */

/* =====================
   Color System & Design System
   ===================== */
/* Primary Color: #3b82f6 (Blue)
   Dark Background: #0f172a
   Dark Surface: #1a1f35, #1f2937
   Dark Border: #2d3748
   Light Text: #e5e7eb
   Muted Text: #9ca3af */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e5e7eb;
    background: #0f172a;
    min-height: 100vh;
}

/* =====================
   Header Top
   ===================== */

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #1a1f35;
    border-bottom: 1px solid #2d3748;
    margin-bottom: 1.5rem;
}

.header-top .title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-email {
    font-size: 0.95rem;
    color: #9ca3af;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-btn span {
    font-size: 1.2rem;
}

/* =====================
   Page Content
   ===================== */

.page-content {
    padding: 2rem;
    overflow-y: auto;
    height: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2d3748;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #e5e7eb;
    letter-spacing: -0.5px;
}

/* =====================
   Cards & Panels
   ===================== */

.card {
    background: #1f2937;
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #3b82f6;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2d3748;
}

.card-icon {
    font-size: 2.5rem;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    border-radius: 8px;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
}

/* =====================
   Grids & Layouts
   ===================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* =====================
   Tables
   ===================== */

.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #111827;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #9ca3af;
    border-bottom: 1px solid #2d3748;
}

td {
    padding: 1rem;
    color: #e5e7eb;
    border-bottom: 1px solid #2d3748;
}

tbody tr:hover {
    background-color: #1f2937;
}

/* =====================
   Buttons
   ===================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #2d3748;
    color: #e5e7eb;
    border: 1px solid #374151;
}

.btn-secondary:hover {
    background: #374151;
    border-color: #3b82f6;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: 1px solid #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-icon {
    background: #3b82f6;
    color: white;
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3b82f6;
}

.btn-icon:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* =====================
   Stats Box
   ===================== */

.stat-box {
    background: #1f2937;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    color: #e5e7eb;
    border: 1px solid #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.stat-icon {
    font-size: 2.5rem;
    color: #3b82f6;
    display: block;
    margin-bottom: 0.75rem;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: #9ca3af;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================
   Forms
   ===================== */

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #e5e7eb;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2d3748;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: #e5e7eb;
    background-color: #111827;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: #1a1f35;
}

/* =====================
   Additional Common Styles
   ===================== */

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.badge-warning {
    background-color: rgba(251, 146, 60, 0.2);
    color: #fdba74;
}

/* =====================
   Table Actions Column
   ===================== */
table td:last-child {
    min-width: 280px;
    white-space: normal;
}

table td:last-child button {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Icon-based action buttons */
.btn-icon-action {
    padding: 0.5rem;
    border: none;
    background-color: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #3b82f6;
    font-size: 1.2rem;
}

.btn-icon-action:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.btn-icon-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon-action .material-symbols-outlined {
    font-size: 1.25rem;
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.divider {
    border-top: 1px solid #2d3748;
    margin: 1.5rem 0;
}

/* =====================
   Modal & Forms
   ===================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1f2937;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #2d3748;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2d3748;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5e7eb;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #3b82f6;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-footer .btn {
    flex: 0 1 auto;
}

/* =====================
   Footer
   ===================== */

footer {
    background-color: #0f172a;
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid #2d3748;
}

/* =====================
   Responsive Design
   ===================== */

@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.5rem;
    }
}

/* =====================
   Utility Classes & Spacing
   ===================== */

/* Spacing */
.mt-1 {
    margin-top: 0.5rem;
}
.mt-2 {
    margin-top: 1rem;
}
.mt-3 {
    margin-top: 1.5rem;
}
.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}
.mb-2 {
    margin-bottom: 1rem;
}
.mb-3 {
    margin-bottom: 1.5rem;
}
.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}
.p-2 {
    padding: 1rem;
}
.p-3 {
    padding: 1.5rem;
}
.p-4 {
    padding: 2rem;
}

/* Text Alignment */
.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}

/* Text Colors */
.text-primary {
    color: #3b82f6;
}
.text-secondary {
    color: #9ca3af;
}
.text-light {
    color: #e5e7eb;
}
.text-muted {
    color: #6b7280;
}

/* Text Styles */
.font-bold {
    font-weight: 700;
}
.font-semibold {
    font-weight: 600;
}
.font-medium {
    font-weight: 500;
}

.text-sm {
    font-size: 0.875rem;
}
.text-base {
    font-size: 1rem;
}
.text-lg {
    font-size: 1.125rem;
}
.text-xl {
    font-size: 1.5rem;
}

/* Flex Utilities */
.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}
.gap-2 {
    gap: 1rem;
}
.gap-3 {
    gap: 1.5rem;
}
.gap-4 {
    gap: 2rem;
}

/* Display */
.block {
    display: block;
}
.inline-block {
    display: inline-block;
}
.hidden {
    display: none;
}

/* Opacity */
.opacity-50 {
    opacity: 0.5;
}
.opacity-75 {
    opacity: 0.75;
}

/* Rounded */
.rounded-sm {
    border-radius: 4px;
}
.rounded {
    border-radius: 6px;
}
.rounded-lg {
    border-radius: 8px;
}
.rounded-full {
    border-radius: 9999px;
}

/* Border */
.border {
    border: 1px solid #2d3748;
}
.border-t {
    border-top: 1px solid #2d3748;
}
.border-b {
    border-bottom: 1px solid #2d3748;
}

/* Shadow */
.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.shadow-lg {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}
.cursor-default {
    cursor: default;
}

/* Transitions */
.transition {
    transition: all 0.3s ease;
}
.transition-fast {
    transition: all 0.15s ease;
}

/* Status Indicators */
.indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.indicator-success {
    background-color: #22c55e;
}
.indicator-warning {
    background-color: #f59e0b;
}
.indicator-danger {
    background-color: #ef4444;
}
.indicator-info {
    background-color: #3b82f6;
}

/* ID Badge styling */
.id-badge {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.employee-id {
    font-size: 0.85rem;
    color: #3b82f6;
    font-weight: 600;
    font-family: "Courier New", Courier, monospace;
    margin-bottom: 0.25rem;
}
