/* A17 TE-Connect CSS - Light Theme Premium Design System */
:root {
    --bg-main: #f3f4f6;
    --bg-header: #0f172a;
    --bg-subheader: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f9fafb;
    
    --color-primary: #1e40af; /* Deep Royal Blue */
    --color-primary-hover: #1e3a8a;
    --color-accent: #3b82f6; /* Modern Blue */
    --color-success: #10b981; /* Green */
    --color-danger: #ef4444; /* Red */
    --color-warning: #f59e0b; /* Amber */
    --color-info: #06b6d4; /* Cyan */
    
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #ffffff;
    
    --border-color: #e5e7eb;
    --border-hover: #cbd5e1;
    
    /* Box Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-glow-blue: 0 4px 20px rgba(59, 130, 246, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Navigation Bar Styles (Navy Blue / Dark Slate) */
.navbar-header {
    background-color: var(--bg-header);
    color: var(--text-light);
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.navbar-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-area {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    color: var(--text-light);
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: -2px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item {
    background: none;
    border: none;
    color: #94a3b8; /* Slate light grey */
    padding: 8px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Dropdown styling */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #1e293b;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    z-index: 200;
    margin-top: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content a {
    color: #94a3b8;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.caret {
    font-size: 0.65rem;
    margin-left: 5px;
    opacity: 0.7;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    color: #94a3b8;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.notification-bell:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.08);
}

.bell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: var(--color-danger);
    border-radius: 50%;
}

.user-profile-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.user-profile-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.avatar-header {
    width: 32px;
    height: 32px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.username-text {
    font-size: 0.88rem;
    font-weight: 500;
}

/* Sub-header Bar (Light banner with shift information) */
.subheader-bar {
    background-color: var(--bg-subheader);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
}

.subheader-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumb-trail {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.shift-info-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.shift-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.shift-badge {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.day-shift {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.shift-time-text {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Main Content Layout */
.main-content-container {
    flex-grow: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

/* Tab Switching Control */
.tab-view {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography elements */
h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Cards (Standard White panels) */
.section-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fafafa;
}

.card-header.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    color: var(--text-primary);
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

/* Grid & Split Layouts */
.split-layout {
    display: flex;
    gap: 20px;
}

.layout-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.layout-main {
    flex-grow: 1;
    min-width: 0; /* Prevents flex children from breaking width */
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 14px;
}

.field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.88rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background-color: #ffffff;
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.form-control-inline {
    display: inline-block;
    width: auto;
}

.form-row {
    display: flex;
    gap: 12px;
}

.col-6 {
    width: 50%;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 6px;
    user-select: none;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background-color: var(--color-success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Utility margins/paddings */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.text-right { text-align: right; }

/* Tables (Premium Dark Header Style) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    background-color: #1e293b; /* Dark Slate Header */
    color: white;
    font-weight: 600;
    padding: 12px 16px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border: none;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr {
    background-color: #ffffff;
    transition: var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.data-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
}

.status-badge.closed, 
.status-badge.done, 
.status-badge.pass {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.cancelled, 
.status-badge.fail {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.inprogress {
    background-color: #ffedd5;
    color: #9a3412;
}

.status-badge.requested, 
.status-badge.todo {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-badge.review {
    background-color: #e0f2fe;
    color: #0369a1;
}

.status-badge.active {
    background-color: #fef3c7;
    color: #92400e;
}

/* Search bar styling */
.search-box-row {
    display: flex;
    gap: 8px;
    max-width: 380px;
    width: 100%;
}

.search-input {
    flex-grow: 1;
}

/* Action button icons/text links in tables */
.btn-action-group {
    display: flex;
    gap: 6px;
}

.pck-action-btn {
    padding: 3px 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.pck-action-btn:hover {
    color: var(--color-danger);
    background-color: #fee2e2;
}

/* Pagination Section */
.pagination-container {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    background-color: #fafafa;
}

.pagination-info {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-page-text {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 24px 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow-blue);
}

.welcome-banner h2 {
    color: white;
    margin-bottom: 6px;
}

.welcome-banner p {
    font-size: 0.92rem;
    opacity: 0.9;
    max-width: 800px;
    line-height: 1.5;
}

/* Announcements elements */
.announcements-list {
    display: flex;
    flex-direction: column;
}

.announcement-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    border-left: 4px solid var(--color-accent);
    background-color: #ffffff;
    transition: var(--transition-fast);
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item:hover {
    background-color: #fafafa;
}

.ann-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ann-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ann-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.ann-badge-new {
    background-color: #3b82f6;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ann-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ann-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.ann-footer-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.ann-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Red indicator dot on the right of announcements */
.ann-indicator-dot {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--color-danger);
    border-radius: 50%;
}

/* Kanban Board Layout (Top navbar Style) */
.kanban-filter-controls {
    display: flex;
    align-items: center;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
    min-height: 500px;
}

.kanban-column {
    background-color: #e5e7eb;
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    max-height: 700px;
}

.column-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.bg-indigo { background-color: var(--color-primary); }
.bg-orange { background-color: var(--color-warning); }
.bg-cyan { background-color: var(--color-info); }
.bg-green { background-color: var(--color-success); }

.column-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    flex-grow: 1;
}

.task-count {
    background-color: rgba(0, 0, 0, 0.07);
    color: #374151;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

.column-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 150px;
    padding: 2px;
}

.column-body.drag-over {
    background-color: rgba(59, 130, 246, 0.08);
    border: 2px dashed var(--color-accent);
    border-radius: var(--radius-sm);
}

/* Kanban Card */
.kanban-card {
    background-color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: var(--transition-fast), transform 0.1s ease;
    user-select: none;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}

.card-priority-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.card-priority-text {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.card-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
    word-break: break-word;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.card-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.card-date.overdue {
    color: var(--color-danger);
    font-weight: 700;
}

.card-date svg {
    width: 12px;
    height: 12px;
}

.card-assignee-avatar {
    width: 22px;
    height: 22px;
    background-color: #cbd5e1;
    color: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
}

/* Modals Overlay & Box */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 580px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-box.small {
    max-width: 420px;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.modal-header h3 {
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 14px 20px 0 20px;
    display: flex;
    gap: 8px;
}

/* Inline form for members list */
.inline-form {
    display: flex;
    gap: 8px;
}

.members-scroll-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
}

.member-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.member-row-item:last-child {
    border-bottom: none;
}

/* Footer Section */
.department-footer {
    background-color: var(--bg-header);
    color: #94a3b8;
    padding: 16px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
}

.footer-left {
    color: #94a3b8;
}

.footer-right {
    color: #64748b;
}

/* Animation utilities */
.animate-pulse {
    animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}
