/* style.css - TB Industries Modern Theme */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-body: #F3F5F9;
    --bg-sidebar: #2A2D3E;
    --bg-card: #FFFFFF;
    --primary: #6C5DD3;
    --primary-hover: #5a4cb4;
    --secondary: #FF7582;
    --success: #33D69F;
    --warning: #FFB830;
    --text-main: #2B2F42;
    --text-muted: #8F92A1;
    --border: #E6E8F0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    --radius: 15px;
    --white: #FFFFFF;
    --gray: #7f8c8d;
    --text: #2B2F42;
}

* { box-sizing: border-box; outline: none; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    overflow: hidden;
}

.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    height: 100%;
    background-color: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 25px 20px;
    flex-shrink: 0;
    overflow-y: auto;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.brand-logo {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-links li { margin-bottom: 8px; }

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #A0A3BD;
    text-decoration: none;
    border-radius: 12px;
    transition: 0.3s;
    font-weight: 500;
    font-size: 14px;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(108, 93, 211, 0.1);
    color: #fff;
}

.nav-links a i { margin-right: 15px; font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.top-header {
    background: var(--bg-card);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title { font-size: 18px; font-weight: 600; color: var(--text-main); }

.header-actions { display: flex; align-items: center; gap: 20px; }

.icon-btn {
    background: #F4F5F7;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: 0.2s;
    position: relative;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 30px;
    transition: 0.2s;
}

.user-profile:hover { background: #F4F5F7; }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.content-wrapper { padding: 30px; }

.grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card-modern {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: transform 0.2s;
}

.card-modern:hover { transform: translateY(-3px); }

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

.card-title { font-size: 16px; font-weight: 600; color: var(--text-main); margin: 0; }

.date-setter {
    background: linear-gradient(135deg, #6C5DD3 0%, #8B78E6 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(108, 93, 211, 0.3);
}

.date-input-group {
    background: rgba(255,255,255,0.2);
    padding: 5px;
    border-radius: 10px;
    display: flex;
    margin-top: 15px;
    backdrop-filter: blur(5px);
}

.date-input-group input {
    background: transparent;
    border: none;
    color: white;
    padding: 10px;
    width: 100%;
    font-family: inherit;
    font-weight: 500;
}
.date-input-group input::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.date-input-group button {
    background: white;
    color: var(--primary);
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}
.activity-list::-webkit-scrollbar { width: 5px; }
.activity-list::-webkit-scrollbar-track { background: #f1f1f1; }
.activity-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 5px; }

.activity-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: start;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}
.activity-item:last-child { border-bottom: none; margin-bottom: 0; }

.activity-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-edit { background: rgba(108, 93, 211, 0.1); color: var(--primary); }
.icon-delete { background: rgba(255, 117, 130, 0.1); color: var(--secondary); }

.hub-card-content { display: flex; justify-content: space-between; margin-bottom: 20px; }
.hub-location { color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.hub-status { 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 11px; 
    font-weight: 600; 
}
.status-active { background: rgba(51, 214, 159, 0.15); color: var(--success); }
.status-pending { background: rgba(255, 184, 48, 0.15); color: var(--warning); }

.finance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.input-mini {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    font-size: 12px;
    background: #FAFAFB;
    transition: 0.2s;
}
.input-mini:focus { background: #fff; border-color: var(--primary); }

.btn-block {
    width: 100%;
    background: var(--bg-body);
    color: var(--text-main);
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}
.btn-block:hover { background: #E2E6EA; }
.btn-monitor { background: var(--primary); color: white; }
.btn-monitor:hover { background: var(--primary-hover); }
.btn-approve { background: var(--success); color: white; width: 48%; }
.btn-reject { background: var(--secondary); color: white; width: 48%; }

.alert-float {
    position: fixed;
    top: 25px;
    right: 25px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--success); }
.alert-danger { background: var(--secondary); }

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

body.login-page {
    overflow-y: auto; 
    background-color: #f4f6f9;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.login-card {
    background: #ffffff;
    padding: 35px 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #6C5DD3, #FF7582);
}

.login-logo {
    font-size: 26px;
    font-weight: 700;
    color: #2B2F42;
    margin-bottom: 5px;
    display: block;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #8F92A1;
    font-size: 13px;
    margin-bottom: 25px;
    display: block;
}

.login-form-group {
    margin-bottom: 15px;
    text-align: left;
    position: relative;
}

.login-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2B2F42;
    margin-bottom: 6px;
    display: block;
}

.login-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 1px solid #E6E8F0;
    background: #FCFCFD;
    border-radius: 12px;
    font-size: 14px;
    color: #2B2F42;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}
.login-input:focus {
    border-color: #6C5DD3;
    background: #fff;
    box-shadow: 0 4px 12px rgba(108, 93, 211, 0.1);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 38px;
    color: #A0A3BD;
    font-size: 16px;
    transition: 0.3s;
    pointer-events: none;
}
.login-input:focus + .input-icon, .login-input:focus ~ .input-icon { color: #6C5DD3; }

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #6C5DD3 0%, #5a4cb4 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(108, 93, 211, 0.2);
    letter-spacing: 0.5px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 15px 25px rgba(108, 93, 211, 0.3); }

.register-link {
    display: block;
    margin-top: 20px;
    text-decoration: none;
    color: #8F92A1;
    font-size: 13px;
    transition: 0.3s;
}
.register-link strong { color: #6C5DD3; font-weight: 600; }
.register-link:hover { color: #2B2F42; }

.alert-error {
    background: #FFF0F1;
    color: #FF7582;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: left;
    border: 1px solid #FFE5E7;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-error i { font-size: 18px; }

.container { max-width: 1400px; margin: 0 auto; padding: 30px; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--bg-card);
    box-shadow: 0 2px 15px rgba(0,0,0,0.02);
}

.brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.user-info a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}
.user-info a:hover { color: var(--primary); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    display: inline-block;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(108, 93, 211, 0.3); }

/* Action buttons in table cells */
td .btn-primary {
    padding: 6px 14px;
    font-size: 0.8em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
td .btn-primary:hover { transform: translateY(-1px); }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 13px;
}
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: 0.3s;
    background: #FAFAFB;
}
.form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 4px 12px rgba(108, 93, 211, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    color: var(--text-main);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.styled-table thead th {
    background: var(--bg-sidebar);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
}
.styled-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}
.styled-table tbody tr:hover { background: #f8f9fa; }

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cal-nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.cal-title {
    font-weight: 600;
    font-size: 16px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px;
}

.cal-day {
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    background: #f8f9fa;
    text-decoration: none;
    color: var(--text-main);
    transition: 0.2s;
    font-size: 13px;
}

.cal-day:hover { background: var(--primary); color: white; }

.cal-day.empty { background: transparent; }

.cal-day.operational { background: var(--success); color: white; }

.cal-day.active-date { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(108, 93, 211, 0.3); }

.day-num { font-weight: 500; }

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.add-hub-panel { 
    background: white; 
    padding: 25px; 
    border-radius: var(--radius); 
    margin-bottom: 30px; 
    box-shadow: var(--shadow); 
    border-left: 5px solid var(--primary); 
}

.form-inline { 
    display: flex; 
    gap: 15px; 
    align-items: flex-end; 
    flex-wrap: wrap; 
}

.card-pending { 
    opacity: 0.9; 
    border-top: 4px solid var(--warning); 
    background: #fffcf5; 
}

.badge-active { 
    background: rgba(51, 214, 159, 0.15); 
    color: var(--success); 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 11px; 
    font-weight: 600; 
}

.badge-pending { 
    background: rgba(255, 184, 48, 0.15); 
    color: var(--warning); 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 11px; 
    font-weight: 600; 
}

.date-display { 
    background: #f3f4f6; 
    color: #374151; 
    padding: 8px 12px; 
    border-radius: 8px; 
    font-size: 0.9em; 
    margin-top: 10px; 
    display: inline-block; 
    font-weight: 500; 
}

/* Edit Hub Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 400px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    font-size: 1.5em;
    color: var(--text-muted);
}

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

/* Total row styling for tables */
.total-row td {
    background: var(--bg-body);
    font-weight: bold;
    border-top: 2px solid var(--border);
    color: var(--text-main);
}

/* Disabled input styling */
.input-disabled {
    background: #e9ecef !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* No batch helper message */
.no-batch-notice {
    background: rgba(255, 184, 48, 0.15);
    border-left: 4px solid var(--warning);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--warning);
}
