/* style.css - AJR Logística V2 */

:root {
    /* Color Palette - Modern & Rich Aesthetics */
    --bg-dark: #0f172a;
    --bg-panel: #1e293b;
    --bg-panel-hover: #334155;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    
    --success: #10b981;
    --success-hover: #059669;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --warning: #f59e0b;
    --warning-hover: #d97706;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Type */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.5);
    
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.hidden {
    display: none !important;
}

.mt-4 { margin-top: 1rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

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

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

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-muted);
}
.btn-icon:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.1);
}

/* Forms */
.input-group {
    margin-bottom: 1.25rem;
    text-align: left;
}
.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.input-group input, .input-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}
.input-group input:focus, .input-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Views */
.view {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login View */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}
.login-header {
    margin-bottom: 2rem;
}
.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 1rem;
}
.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}
.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Dashboard View */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon-small {
    color: var(--primary);
    width: 24px;
    height: 24px;
}
.header-left h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.badge {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    font-weight: 700;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
}
.role-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin: 1.5rem;
    border-radius: var(--radius-md);
}
.stat-box {
    text-align: center;
    padding: 0.5rem;
}
.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.text-blue { color: #60a5fa; }
.text-green { color: #34d399; }
.text-orange { color: #fbbf24; }
.text-red { color: #f87171; }
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Kanban Board */
.kanban-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 1.5rem 1.5rem 1.5rem;
}
.board-wrapper {
    display: flex;
    gap: 1.25rem;
    height: 100%;
    align-items: flex-start;
}
.kanban-list {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    min-width: 320px;
    width: 320px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}
.list-header {
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-count {
    background: rgba(0,0,0,0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}
.list-cards {
    padding: 0.75rem;
    overflow-y: auto;
    flex: 1;
    min-height: 50px; /* For dropping */
}

/* Kanban Cards */
.kanban-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
}
.kanban-card:hover {
    border-color: rgba(255,255,255,0.2);
    box-shadow: var(--shadow-md);
}
.kanban-card:active {
    cursor: grabbing;
}
.card-labels {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.label {
    height: 6px;
    width: 30px;
    border-radius: 3px;
}
.label-entrega { background-color: var(--success); }
.label-retirada { background-color: var(--primary); }
.label-troca { background-color: #a855f7; }

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.card-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.card-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.driver-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
}

/* Driver Mobile View */
.mobile-header {
    background: var(--bg-panel);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.driver-content {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}
.driver-panel {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}
.driver-panel h3 {
    margin-bottom: 1rem;
}
.driver-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.status-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Loading & Toast */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--bg-panel);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
