/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F8F9FA; /* Clean Slate */
    color: #1A1A1A; /* Deep Charcoal */
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
.site-header {
    background: #1A1A1A; /* Deep Charcoal */
    color: #F8F9FA;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo h1 {
    font-size: 1.5rem;
    color: #F2741F; /* Cendco Orange */
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav a {
    color: #F8F9FA;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: #F2741F;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background: #F2741F;
    transition: transform 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    transform: translateX(-50%) scaleX(1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: #F8F9FA;
    font-size: 0.9rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid #F2741F;
    color: #F2741F;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #F2741F;
    color: white;
}

/* ===== MOBILE MENU ===== */
.mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: #1A1A1A;
        padding: 1rem;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }
    .main-nav.active {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    .main-nav li {
        margin: 0.5rem 0;
    }
    .header-inner {
        flex-wrap: wrap;
    }
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 70px - 100px);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #E9ECEF;
}

.page-header h1 {
    font-size: 2rem;
    color: #1A1A1A;
    position: relative;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #F2741F;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: #F2741F;
    color: white;
}

.btn-primary:hover {
    background: #d45f0f;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(242,116,31,0.3);
}

.btn-secondary {
    background: #2C3E50; /* Lab Navy */
    color: white;
}

.btn-secondary:hover {
    background: #1e2b37;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #bb2d3b;
}

.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

/* ===== ACTION LINKS (Edit/Delete) ===== */
.action-links {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.action-link.edit {
    background: #2C3E50;
    color: white;
}

.action-link.edit:hover {
    background: #1e2b37;
    transform: scale(1.1);
}

.action-link.delete {
    background: #dc3545;
    color: white;
}

.action-link.delete:hover {
    background: #bb2d3b;
    transform: scale(1.1);
}

.action-link.view {
    background: #F2741F;
    color: white;
}

.action-link.view:hover {
    background: #d45f0f;
}

/* For text links instead of icons */
.action-link-text {
    color: #2C3E50;
    text-decoration: none;
    margin: 0 5px;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background 0.3s;
}

.action-link-text:hover {
    background: #E9ECEF;
}

.action-link-text.delete:hover {
    color: #dc3545;
    background: #ffe6e6;
}

/* ===== STATS CARDS (Dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 2.5rem;
    color: #F2741F;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1A1A1A;
    line-height: 1.2;
}

.stat-label {
    font-size: 1rem;
    color: #2C3E50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: #2C3E50; /* Lab Navy */
    color: white;
}

th {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #E9ECEF;
    vertical-align: middle;
}

tbody tr:hover {
    background: #F8F9FA;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Thumbnail images in tables */
.table-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #E9ECEF;
}

/* Badges for stock status */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* ===== FORMS ===== */
.form-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid #E9ECEF;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2C3E50;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #F2741F;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* File input styling */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-button {
    background: #E9ECEF;
    color: #1A1A1A;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: inline-block;
    cursor: pointer;
    border: 2px solid #E9ECEF;
    transition: all 0.3s;
}

.file-input-button:hover {
    background: #dde2e6;
}

/* ===== GALLERY PREVIEW ===== */
.gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.gallery-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #E9ECEF;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220,53,69,0.9);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}

/* ===== ALERTS & MESSAGES ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert .close {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: 5px;
    background: white;
    border: 1px solid #E9ECEF;
    color: #2C3E50;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #F2741F;
    color: white;
    border-color: #F2741F;
}

.pagination .active {
    background: #F2741F;
    color: white;
    border-color: #F2741F;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #1A1A1A;
    color: #F8F9FA;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

/* ===== UTILITIES ===== */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.help-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Summernote toolbar fix */
.note-editor.note-lite .note-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 5px 10px !important;
}
.note-editor.note-lite .note-btn {
    background: transparent !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    margin: 2px !important;
}
.note-editor.note-lite .note-btn:hover {
    background: #e9ecef !important;
}
.note-editable {
    min-height: 200px !important;
}

/* Summernote toolbar visibility fix */
.note-editor.note-frame .note-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 5px 10px !important;
}
.note-editor.note-frame .note-btn {
    background: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    padding: 0.25rem 0.5rem !important;
    margin: 2px !important;
}
.note-editor.note-frame .note-btn:hover {
    background: #e9ecef !important;
}
.note-editor.note-frame .note-editable {
    background: white !important;
}