/* dashboard.css — page-specific styles for dashboard.html */

/* Quick actions (header row) */
.quick-actions { display: flex; gap: 10px; }
.btn-action {
    padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; font-family: inherit; transition: all 0.2s;
}
.btn-action.primary { background: #FF8C00; color: #fff; }
.btn-action.primary:hover { background: #E07B00; }
.btn-action.secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-action.secondary:hover { background: #f9fafb; }

/* Stat cards — base styles moved to common.css */
/* Dashboard override: 3→6 columns */
.stat-grid { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1200px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }

/* Weather card */
.stat-card.weather { background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%); color: #fff; overflow: hidden; position: relative; border-color: transparent; }
.stat-card.weather .stat-card-header { background: transparent; border-bottom-color: rgba(255,255,255,0.15); }
.stat-card.weather .stat-card-label { color: rgba(255,255,255,0.9); }
.stat-card.weather .stat-card-icon { background: rgba(255,255,255,0.2); color: #fff; }

/* Currency card */
.stat-card.currency .stat-card-icon { background: #dbeafe; color: #1e88e5; }
.stat-card.weather .stat-label { color: rgba(255,255,255,0.8); }
.weather-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.weather-icon { font-size: 32px; line-height: 1; }
.weather-temp { font-size: 28px; font-weight: 700; color: #fff; }
.weather-desc { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 4px; }
.weather-city { font-size: 12px; color: rgba(255,255,255,0.6); position: absolute; top: 16px; right: 20px; }

/* Currency card */
.stat-card.currency { background: #dbeafe; }
.currency-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.currency-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.currency-flag-code { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #374151; }
.currency-flag { font-size: 16px; line-height: 1; }
.currency-rate { font-weight: 700; color: #1e88e5; }

/* Top couriers widget */
.courier-list { display: flex; flex-direction: column; gap: 0; }
.courier-header { display: flex; padding: 8px 16px; border-bottom: 1px solid #e5e7eb; }
.courier-header span { font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.courier-header span:first-child { flex: 1; }
.courier-header span:nth-child(2),
.courier-header span:nth-child(3) { width: 70px; text-align: center; flex-shrink: 0; }
.courier-item { display: flex; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f3f4f6; transition: background 0.15s; }
.courier-item:last-child { border-bottom: none; }
.courier-item:hover { background: #f9fafb; }
.courier-name { font-size: 13px; font-weight: 500; color: #1a1a1a; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.courier-nums { display: flex; flex-shrink: 0; }
.courier-num { width: 70px; text-align: center; font-size: 14px; font-weight: 700; color: #1a1a1a; }
.courier-num.delivered { color: #059669; }

/* Quick action buttons (large row) */
.quick-actions { display: flex; align-items: center; gap: 12px; }
.quick-action-btn {
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px;
    padding: 8px 18px; line-height: 1;
    background: #FF8C00; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; font-family: inherit; color: #fff;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
    white-space: nowrap;
}
.quick-action-btn:hover { background: #E07B00; color: #fff; }
.quick-action-btn svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; flex-shrink: 0; }
.quick-action-btn span { margin-center: 0px; }

/* Ticket widget */
.ticket-list { max-height: 340px; overflow-y: auto; }
.ticket-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin: 0 -16px; border-bottom: 1px solid #f3f4f6; transition: background 0.2s; cursor: pointer; }
.ticket-item:hover { background: #f4f5f7; box-shadow: inset 0 1px 4px rgba(0,0,0,0.06); }
.ticket-item:last-child { border-bottom: 1px solid #f3f4f6; }
.ticket-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ticket-status-dot.open { background: #f59e0b; }
.ticket-status-dot.in_progress { background: #3b82f6; }
.ticket-status-dot.resolved { background: #10b981; }
.ticket-status-dot.closed { background: #9ca3af; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-subject { font-size: 13px; font-weight: 500; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.ticket-badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ticket-badge.open { background: #fef3c7; color: #92400e; }
.ticket-badge.in_progress { background: #dbeafe; color: #1e40af; }
.ticket-badge.resolved { background: #d1fae5; color: #065f46; }
.ticket-badge.closed { background: #f3f4f6; color: #6b7280; }

/* Widgets grid */
.widgets { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }

/* Calendar + Top couriers row (same 2fr 1fr ratio so couriers matches ticket column width) */
.calendar-couriers-row { display: grid !important; grid-template-columns: 3fr 1fr !important; gap: 16px; align-items: start; }
.calendar-couriers-row > .widget { min-width: 0; }
.calendar-couriers-row .calendar-widget .calendar-body { padding: 12px 16px; }
.courier-subtitle { font-size: 12px; color: #9ca3af; }
@media (max-width: 900px) {
    .calendar-couriers-row { grid-template-columns: 1fr !important; }
}
.widget {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; transition: box-shadow 0.2s;
}
.widget:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.widget-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.widget-header-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.widget-header h3 { font-size: 15px; font-weight: 600; margin-right: auto; }
.widget-header a { font-size: 12px; color: #FF8C00; text-decoration: none; font-weight: 500; flex-shrink: 0; }
.widget-body { padding: 0; position: relative; }
.widget-body.has-overflow::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)); pointer-events: none; border-radius: 0 0 12px 12px; z-index: 1; }

/* Deliveries widget */
.deliveries-scroll { max-height: 340px; overflow-y: auto; }
.deliveries-scroll td:last-child { white-space: nowrap; }
.deliveries-scroll th:nth-child(4), .deliveries-scroll td:nth-child(4),
.deliveries-scroll th:nth-child(5), .deliveries-scroll td:nth-child(5) { text-align: center; }
.deliveries-scroll tbody tr { transition: background 0.2s, box-shadow 0.2s; cursor: pointer; }
.deliveries-scroll tbody tr:hover { background: #f4f5f7; box-shadow: inset 0 1px 4px rgba(0,0,0,0.06); }
@media (max-width: 600px) {
    .deliveries-scroll table { table-layout: auto; }
    .deliveries-scroll th:nth-child(3),
    .deliveries-scroll td:nth-child(3) { text-align: left; }
}

/* Notifications widget */
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { padding: 12px 20px; border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: background 0.2s; }
.notif-item:hover { background: #f4f5f7; box-shadow: inset 0 1px 4px rgba(0,0,0,0.06); }
.notif-item.unread { border-left: 3px solid #FF8C00; }
.notif-title { font-size: 13px; font-weight: 500; }
.notif-msg { font-size: 12px; color: #6b7280; margin-top: 2px; }
.notif-time { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* Widget spacing (legacy, now handled by #dashboardSections gap) */
.widget-mt { margin-top: 0; }

/* Calendar widget */
.calendar-body { padding: 16px 20px; }

.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-nav-btn {
    width: 28px; height: 28px; border: none; background: #f3f4f6; border-radius: 6px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #374151; transition: all 0.15s;
}
.calendar-nav-btn:hover { background: #FF8C00; color: #fff; }
.calendar-nav-title { font-size: 14px; font-weight: 600; color: #1a1a1a; min-width: 130px; text-align: center; }

.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.calendar-weekday {
    text-align: center; font-size: 11px; font-weight: 600; color: #9ca3af;
    padding: 8px 0 6px; text-transform: uppercase;
}
.calendar-day {
    position: relative; text-align: center; padding: 10px 4px; border-radius: 8px;
    font-size: 13px; color: #374151; cursor: pointer; transition: all 0.15s;
    min-height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.calendar-day:hover { background: #f9fafb; }
.calendar-day.other-month { color: #d1d5db; }
.calendar-day.today { background: #eff6ff; font-weight: 700; color: #2563eb; }
.calendar-day.has-orders { background: #FFF7ED; }
.calendar-day.selected { background: #FF8C00; color: #fff; }
.calendar-day-num { line-height: 1; }
.calendar-day-badge {
    position: absolute; top: 3px; right: 3px;
    font-size: 9px; font-weight: 600; color: #FF8C00; line-height: 1;
}
.calendar-day.selected .calendar-day-badge { color: rgba(255,255,255,0.85); }

/* Holiday */
.calendar-day.holiday { background: #fef2f2; }
.calendar-day.holiday .calendar-day-num { color: #ef4444; }
.calendar-holiday-dot {
    display: block; width: 5px; height: 5px; border-radius: 50%;
    background: #ef4444; margin: 3px auto 0;
}
.calendar-day.selected.holiday { background: #FF8C00; }
.calendar-day.selected.holiday .calendar-day-num { color: #fff; }
.calendar-day.selected .calendar-holiday-dot { background: #fff; }

/* Day panel */
.calendar-day-panel { display: none; margin-top: 16px; border-top: 1px solid #f3f4f6; padding-top: 12px; }
.calendar-day-panel.visible { display: block; }
.calendar-day-panel-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
    font-size: 13px; font-weight: 600; color: #1a1a1a;
}
.calendar-day-panel-close {
    width: 24px; height: 24px; border: none; background: #f3f4f6; border-radius: 6px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; color: #6b7280;
}
.calendar-day-panel-close:hover { background: #e5e7eb; }
.calendar-day-orders { display: flex; flex-direction: column; gap: 0; }
.calendar-order-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 8px; border-bottom: 1px solid #f3f4f6; font-size: 13px;
    cursor: pointer; border-radius: 6px; transition: background 0.15s;
}
.calendar-order-item:hover { background: #f9fafb; }
.calendar-order-item:last-child { border-bottom: none; }
.calendar-order-track { font-weight: 600; color: #1a1a1a; white-space: nowrap; }
.calendar-order-courier { color: #3b82f6; font-size: 12px; font-weight: 500; white-space: nowrap; }
.calendar-order-company { color: #6b7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-order-address { color: #9ca3af; font-size: 11px; }
.calendar-order-price { font-weight: 600; color: #059669; font-size: 12px; white-space: nowrap; }
.calendar-order-empty { font-size: 13px; color: #9ca3af; text-align: center; padding: 16px 0; }

/* Clock widget (standalone section) */
.stat-card.clock {
    background: #fff;
    color: #1a1a1a; border-radius: 16px; padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Clock grid — adapts to city count */
.clock-list { display: grid; gap: 16px; }
.clock-list[data-count="1"] { grid-template-columns: 1fr; max-width: 240px; margin: 0 auto; }
.clock-list[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.clock-list[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.clock-list[data-count="4"] { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .clock-list[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .clock-list[data-count="2"],
    .clock-list[data-count="3"],
    .clock-list[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
    .clock-time { font-size: 22px; }
    .clock-seconds { font-size: 13px; }
}

/* Digital clock item */
.clock-item { text-align: center; padding: 16px 8px; border-radius: 12px; background: #f3f4f6; transition: background 0.2s; }
.clock-item:hover { background: #e5e7eb; }
.clock-city { display: block; font-size: 12px; color: #6b7280; font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.clock-time {
    display: block; font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-weight: 700; color: #1a1a1a; font-size: 28px; letter-spacing: 1px; line-height: 1;
}
.clock-seconds { font-size: 16px; color: #9ca3af; }
.clock-date { display: block; font-size: 11px; color: #9ca3af; margin-top: 6px; }

/* Analog clock item */
.clock-item.analog {
    padding: 20px 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}
.clock-item.analog:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    background: #ffffff;
}
.clock-analog-face { display: block; margin: 0 auto 6px; }
.clock-item.analog .clock-city {
    margin-bottom: 0; margin-top: 2px;
    font-size: 11px; font-weight: 600; color: #6b7280;
    letter-spacing: 1.5px;
}
.clock-time-small {
    display: block; font-size: 13px; font-weight: 500; color: #9ca3af;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    margin-top: 2px; letter-spacing: 0.5px;
}

/* Drag & Drop sections */
#dashboardSections { display: flex; flex-direction: column; gap: 24px; }
.dashboard-section { position: relative; }
.drag-handle {
    position: absolute; top: 8px; left: -28px; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab; opacity: 0.2; transition: opacity 0.2s;
    color: #9ca3af; border-radius: 4px; z-index: 2;
}
.drag-handle:hover { color: #6b7280; background: #f3f4f6; opacity: 1; }
.drag-handle:active { cursor: grabbing; }
.dashboard-section:hover > .drag-handle { opacity: 0.7; }

/* SortableJS ghost & chosen */
.dashboard-section.sortable-ghost {
    opacity: 0.4;
}
.dashboard-section.sortable-chosen {
    outline: 2px dashed #FF8C00; outline-offset: 4px; border-radius: 12px;
}
.dashboard-section.sortable-drag {
    opacity: 0.9; box-shadow: 0 8px 24px rgba(0,0,0,0.12); border-radius: 12px;
}
